
<!DOCTYPE HTML>
<html lang="zh-hans" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>Golang 代码规范 · 这是程序员吗</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.3">
        <meta name="author" content="xishengcai">
        
        
    
    
    <link rel="stylesheet" href="../../gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-expandable-chapters/expandable-chapters.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-toggle-chapters/toggle.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-search-plus/search.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-disqus/plugin.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-prism/prism-base16-ateliersulphurpool.light.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-advanced-emoji/emoji-website.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-anchors/plugin.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-emphasize/plugin.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-katex/katex.min.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-splitter/splitter.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-mermaid-gb3/mermaid/mermaid.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-tbfed-pagefooter/footer.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-expandable-chapters-small/expandable-chapters-small.css">
                
            
                
                <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-sectionx/sectionx.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-donate/plugin.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-local-video/video-js.min.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-anchor-navigation-ex/style/plugin.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-terminal/plugin.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-alerts/style.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-versions-select/plugin.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-fontsettings/website.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-theme-comscore/test.css">
                
            
        

    

    
        
    
        
    
        
    
        
    
        
    
        
    


    

        
    
    
    
    
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../../gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="../../gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="readme.html" />
    
    
    <link rel="prev" href="git规范.html" />
    

    
    <link rel="stylesheet" href="../../gitbook/gitbook-plugin-chart/c3/c3.min.css">
    <script src="../../gitbook/gitbook-plugin-chart/c3/d3.min.js"></script>
    <script src="../../gitbook/gitbook-plugin-chart/c3/c3.min.js"></script>
    

    <script src="../../gitbook/gitbook-plugin-graph/d3.min.js"></script>
    <script src="../../gitbook/gitbook-plugin-graph/function-plot.js"></script>    

    
        <link rel="shortcut icon" href='../../favicon.ico' type="image/x-icon">
    
    
        <link rel="bookmark" href='../../favicon.ico' type="image/x-icon">
    
    
    

    <style>
    @media only screen and (max-width: 640px) {
        .book-header .hidden-mobile {
            display: none;
        }
    }
    </style>
    <script>
        window["gitbook-plugin-github-buttons"] = {"repo":"xishengcai/xisheng.blog","types":["star"],"size":"small"};
    </script>

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="输入并搜索" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    
    
        
        <li>
            <a href="https://xisheng.vip" target="_blank" class="custom-link">Home</a>
        </li>
    
    

    
    <li class="divider"></li>
    

    
        
        <li class="header">Blog</li>
        
        
    
        <li class="chapter " data-level="1.1" data-path="../../">
            
                <a href="../../">
            
                    
                        <b>1.1.</b>
                    
                    Introduction
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="../algorithm/">
            
                <a href="../algorithm/">
            
                    
                        <b>1.2.</b>
                    
                    Algorithm
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.2.1" data-path="../algorithm/heap.html">
            
                <a href="../algorithm/heap.html">
            
                    
                        <b>1.2.1.</b>
                    
                    Heap
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.2" data-path="../algorithm/readme.html">
            
                <a href="../algorithm/readme.html">
            
                    
                        <b>1.2.2.</b>
                    
                    Readme
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.3" data-path="../angular/">
            
                <a href="../angular/">
            
                    
                        <b>1.3.</b>
                    
                    Angular
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.3.1" data-path="../angular/1-start.html">
            
                <a href="../angular/1-start.html">
            
                    
                        <b>1.3.1.</b>
                    
                    Start
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.2" data-path="../angular/2-component.html">
            
                <a href="../angular/2-component.html">
            
                    
                        <b>1.3.2.</b>
                    
                    Component
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.3" data-path="../angular/3-form.html">
            
                <a href="../angular/3-form.html">
            
                    
                        <b>1.3.3.</b>
                    
                    Form
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.4" data-path="../angular/readme.html">
            
                <a href="../angular/readme.html">
            
                    
                        <b>1.3.4.</b>
                    
                    Readme
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.4" data-path="../database/">
            
                <a href="../database/">
            
                    
                        <b>1.4.</b>
                    
                    Database
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.4.1" data-path="../database/mongodb.html">
            
                <a href="../database/mongodb.html">
            
                    
                        <b>1.4.1.</b>
                    
                    Mongodb
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.2" data-path="../database/readme.html">
            
                <a href="../database/readme.html">
            
                    
                        <b>1.4.2.</b>
                    
                    Readme
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.5" data-path="../docker/">
            
                <a href="../docker/">
            
                    
                        <b>1.5.</b>
                    
                    Docker
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.5.1" data-path="../docker/CentOS.html">
            
                <a href="../docker/CentOS.html">
            
                    
                        <b>1.5.1.</b>
                    
                    CentOS
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.2" data-path="../docker/install.html">
            
                <a href="../docker/install.html">
            
                    
                        <b>1.5.2.</b>
                    
                    Install
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.3" data-path="../docker/readme.html">
            
                <a href="../docker/readme.html">
            
                    
                        <b>1.5.3.</b>
                    
                    Readme
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.4" data-path="../docker/官方shell.html">
            
                <a href="../docker/官方shell.html">
            
                    
                        <b>1.5.4.</b>
                    
                    官方Shell
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.6" data-path="../golang/">
            
                <a href="../golang/">
            
                    
                        <b>1.6.</b>
                    
                    Golang
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.6.1" data-path="../golang/aop.html">
            
                <a href="../golang/aop.html">
            
                    
                        <b>1.6.1.</b>
                    
                    Aop
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.2" data-path="../golang/base/">
            
                <a href="../golang/base/">
            
                    
                        <b>1.6.2.</b>
                    
                    Base
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.6.2.1" data-path="../golang/base/copy.html">
            
                <a href="../golang/base/copy.html">
            
                    
                        <b>1.6.2.1.</b>
                    
                    Copy
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.2.2" data-path="../golang/base/new_and_make.html">
            
                <a href="../golang/base/new_and_make.html">
            
                    
                        <b>1.6.2.2.</b>
                    
                    New And Make
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.2.3" data-path="../golang/base/readme.html">
            
                <a href="../golang/base/readme.html">
            
                    
                        <b>1.6.2.3.</b>
                    
                    Readme
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.2.4" data-path="../golang/base/reflect.html">
            
                <a href="../golang/base/reflect.html">
            
                    
                        <b>1.6.2.4.</b>
                    
                    Reflect
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.2.5" data-path="../golang/base/string.html">
            
                <a href="../golang/base/string.html">
            
                    
                        <b>1.6.2.5.</b>
                    
                    String
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.2.6" data-path="../golang/base/tag.html">
            
                <a href="../golang/base/tag.html">
            
                    
                        <b>1.6.2.6.</b>
                    
                    Tag
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.6.3" data-path="../golang/clouser.html">
            
                <a href="../golang/clouser.html">
            
                    
                        <b>1.6.3.</b>
                    
                    Clouser
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.4" data-path="../golang/err 优雅处理.html">
            
                <a href="../golang/err 优雅处理.html">
            
                    
                        <b>1.6.4.</b>
                    
                    Err 优雅处理
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.5" data-path="../golang/go module 2.html">
            
                <a href="../golang/go module 2.html">
            
                    
                        <b>1.6.5.</b>
                    
                    Go Module 2
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.6" data-path="../golang/go_mod.html">
            
                <a href="../golang/go_mod.html">
            
                    
                        <b>1.6.6.</b>
                    
                    Go Mod
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.7" data-path="../golang/gocraftwork.html">
            
                <a href="../golang/gocraftwork.html">
            
                    
                        <b>1.6.7.</b>
                    
                    Gocraftwork
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.8" data-path="../golang/oauth.html">
            
                <a href="../golang/oauth.html">
            
                    
                        <b>1.6.8.</b>
                    
                    Oauth
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.9" data-path="../golang/readme.html">
            
                <a href="../golang/readme.html">
            
                    
                        <b>1.6.9.</b>
                    
                    Readme
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.10" data-path="../golang/swagger.html">
            
                <a href="../golang/swagger.html">
            
                    
                        <b>1.6.10.</b>
                    
                    Swagger
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.11" data-path="../golang/tls.html">
            
                <a href="../golang/tls.html">
            
                    
                        <b>1.6.11.</b>
                    
                    Tls
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.12" >
            
                <span>
            
                    
                        <b>1.6.12.</b>
                    
                    代码走读
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.6.12.1" data-path="../golang/代码走读/2020.5.26.html">
            
                <a href="../golang/代码走读/2020.5.26.html">
            
                    
                        <b>1.6.12.1.</b>
                    
                    2020.5.26
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.6.13" data-path="../golang/任务队列/">
            
                <a href="../golang/任务队列/">
            
                    
                        <b>1.6.13.</b>
                    
                    任务队列
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.6.13.1" data-path="../golang/任务队列/gocraft-worker.html">
            
                <a href="../golang/任务队列/gocraft-worker.html">
            
                    
                        <b>1.6.13.1.</b>
                    
                    Gocraft Worker
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.13.2" data-path="../golang/任务队列/readme.html">
            
                <a href="../golang/任务队列/readme.html">
            
                    
                        <b>1.6.13.2.</b>
                    
                    Readme
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.6.14" data-path="../golang/参数校验.html">
            
                <a href="../golang/参数校验.html">
            
                    
                        <b>1.6.14.</b>
                    
                    参数校验
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.7" data-path="../istio/">
            
                <a href="../istio/">
            
                    
                        <b>1.7.</b>
                    
                    Istio
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.7.1" data-path="../istio/readme.html">
            
                <a href="../istio/readme.html">
            
                    
                        <b>1.7.1.</b>
                    
                    Readme
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.2" data-path="../istio/virtualservice.html">
            
                <a href="../istio/virtualservice.html">
            
                    
                        <b>1.7.2.</b>
                    
                    Virtualservice
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.8" >
            
                <span>
            
                    
                        <b>1.8.</b>
                    
                    Java
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.8.1" data-path="../java/jvm.html">
            
                <a href="../java/jvm.html">
            
                    
                        <b>1.8.1.</b>
                    
                    Jvm
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.2" data-path="../java/typescript.html">
            
                <a href="../java/typescript.html">
            
                    
                        <b>1.8.2.</b>
                    
                    Typescript
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.9" data-path="../kubernetes/">
            
                <a href="../kubernetes/">
            
                    
                        <b>1.9.</b>
                    
                    Kubernetes
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.9.1" data-path="../kubernetes/APIService.html">
            
                <a href="../kubernetes/APIService.html">
            
                    
                        <b>1.9.1.</b>
                    
                    APIService
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.2" data-path="../kubernetes/CAK.html">
            
                <a href="../kubernetes/CAK.html">
            
                    
                        <b>1.9.2.</b>
                    
                    CAK
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.3" data-path="../kubernetes/Deployment 的实现原理.html">
            
                <a href="../kubernetes/Deployment 的实现原理.html">
            
                    
                        <b>1.9.3.</b>
                    
                    Deployment 的实现原理
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.4" data-path="../kubernetes/K8s源码/">
            
                <a href="../kubernetes/K8s源码/">
            
                    
                        <b>1.9.4.</b>
                    
                    K8s源码
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.9.4.1" data-path="../kubernetes/K8s源码/calico 源码分析.html">
            
                <a href="../kubernetes/K8s源码/calico 源码分析.html">
            
                    
                        <b>1.9.4.1.</b>
                    
                    Calico 源码分析
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.4.2" data-path="../kubernetes/K8s源码/garbage collector controller 源码分析.html">
            
                <a href="../kubernetes/K8s源码/garbage collector controller 源码分析.html">
            
                    
                        <b>1.9.4.2.</b>
                    
                    Garbage Collector Controller 源码分析
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.4.3" data-path="../kubernetes/K8s源码/job.html">
            
                <a href="../kubernetes/K8s源码/job.html">
            
                    
                        <b>1.9.4.3.</b>
                    
                    Job
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.4.4" data-path="../kubernetes/K8s源码/kube-proxy-iptables.html">
            
                <a href="../kubernetes/K8s源码/kube-proxy-iptables.html">
            
                    
                        <b>1.9.4.4.</b>
                    
                    Kube Proxy Iptables
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.4.5" data-path="../kubernetes/K8s源码/kube-proxy-ipvs.html">
            
                <a href="../kubernetes/K8s源码/kube-proxy-ipvs.html">
            
                    
                        <b>1.9.4.5.</b>
                    
                    Kube Proxy Ipvs
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.4.6" data-path="../kubernetes/K8s源码/kube-proxy.html">
            
                <a href="../kubernetes/K8s源码/kube-proxy.html">
            
                    
                        <b>1.9.4.6.</b>
                    
                    Kube Proxy
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.4.7" data-path="../kubernetes/K8s源码/kubectl-exec.html">
            
                <a href="../kubernetes/K8s源码/kubectl-exec.html">
            
                    
                        <b>1.9.4.7.</b>
                    
                    Kubectl Exec
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.4.8" data-path="../kubernetes/K8s源码/kubectl源码阅读1.html">
            
                <a href="../kubernetes/K8s源码/kubectl源码阅读1.html">
            
                    
                        <b>1.9.4.8.</b>
                    
                    Kubectl源码阅读1
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.4.9" data-path="../kubernetes/K8s源码/kubectl源码阅读2.html">
            
                <a href="../kubernetes/K8s源码/kubectl源码阅读2.html">
            
                    
                        <b>1.9.4.9.</b>
                    
                    Kubectl源码阅读2
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.4.10" data-path="../kubernetes/K8s源码/readme.html">
            
                <a href="../kubernetes/K8s源码/readme.html">
            
                    
                        <b>1.9.4.10.</b>
                    
                    Readme
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.4.11" data-path="../kubernetes/K8s源码/schedule.html">
            
                <a href="../kubernetes/K8s源码/schedule.html">
            
                    
                        <b>1.9.4.11.</b>
                    
                    Schedule
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.4.12" data-path="../kubernetes/K8s源码/scheme.html">
            
                <a href="../kubernetes/K8s源码/scheme.html">
            
                    
                        <b>1.9.4.12.</b>
                    
                    Scheme
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.4.13" data-path="../kubernetes/K8s源码/调度队列.html">
            
                <a href="../kubernetes/K8s源码/调度队列.html">
            
                    
                        <b>1.9.4.13.</b>
                    
                    调度队列
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.9.5" data-path="../kubernetes/Karmada.html">
            
                <a href="../kubernetes/Karmada.html">
            
                    
                        <b>1.9.5.</b>
                    
                    Karmada
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.6" data-path="../kubernetes/Pixie.html">
            
                <a href="../kubernetes/Pixie.html">
            
                    
                        <b>1.9.6.</b>
                    
                    Pixie
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.7" data-path="../kubernetes/admission access.html">
            
                <a href="../kubernetes/admission access.html">
            
                    
                        <b>1.9.7.</b>
                    
                    Admission Access
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.8" data-path="../kubernetes/ccm.html">
            
                <a href="../kubernetes/ccm.html">
            
                    
                        <b>1.9.8.</b>
                    
                    Ccm
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.9" data-path="../kubernetes/client-go.html">
            
                <a href="../kubernetes/client-go.html">
            
                    
                        <b>1.9.9.</b>
                    
                    Client Go
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.10" data-path="../kubernetes/command.html">
            
                <a href="../kubernetes/command.html">
            
                    
                        <b>1.9.10.</b>
                    
                    Command
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.11" data-path="../kubernetes/controller.html">
            
                <a href="../kubernetes/controller.html">
            
                    
                        <b>1.9.11.</b>
                    
                    Controller
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.12" data-path="../kubernetes/copy docker config.html">
            
                <a href="../kubernetes/copy docker config.html">
            
                    
                        <b>1.9.12.</b>
                    
                    Copy Docker Config
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.13" data-path="../kubernetes/etcd-operation.html">
            
                <a href="../kubernetes/etcd-operation.html">
            
                    
                        <b>1.9.13.</b>
                    
                    Etcd Operation
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.14" data-path="../kubernetes/gc.html">
            
                <a href="../kubernetes/gc.html">
            
                    
                        <b>1.9.14.</b>
                    
                    Gc
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.15" data-path="../kubernetes/helm chart.html">
            
                <a href="../kubernetes/helm chart.html">
            
                    
                        <b>1.9.15.</b>
                    
                    Helm Chart
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.16" data-path="../kubernetes/helm.html">
            
                <a href="../kubernetes/helm.html">
            
                    
                        <b>1.9.16.</b>
                    
                    Helm
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.17" >
            
                <span>
            
                    
                        <b>1.9.17.</b>
                    
                    Helm
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.9.17.1" data-path="../kubernetes/helm/charts.html">
            
                <a href="../kubernetes/helm/charts.html">
            
                    
                        <b>1.9.17.1.</b>
                    
                    Charts
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.17.2" data-path="../kubernetes/helm/helm 钩子函数.html">
            
                <a href="../kubernetes/helm/helm 钩子函数.html">
            
                    
                        <b>1.9.17.2.</b>
                    
                    Helm 钩子函数
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.17.3" data-path="../kubernetes/helm/helm-operator.html">
            
                <a href="../kubernetes/helm/helm-operator.html">
            
                    
                        <b>1.9.17.3.</b>
                    
                    Helm Operator
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.17.4" data-path="../kubernetes/helm/文档查询.html">
            
                <a href="../kubernetes/helm/文档查询.html">
            
                    
                        <b>1.9.17.4.</b>
                    
                    文档查询
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.17.5" data-path="../kubernetes/helm/语法.html">
            
                <a href="../kubernetes/helm/语法.html">
            
                    
                        <b>1.9.17.5.</b>
                    
                    语法
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.9.18" data-path="../kubernetes/install.html">
            
                <a href="../kubernetes/install.html">
            
                    
                        <b>1.9.18.</b>
                    
                    Install
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.19" data-path="../kubernetes/istio-inject.html">
            
                <a href="../kubernetes/istio-inject.html">
            
                    
                        <b>1.9.19.</b>
                    
                    Istio Inject
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.20" >
            
                <span>
            
                    
                        <b>1.9.20.</b>
                    
                    KubeEdge
            
                </span>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.21" data-path="../kubernetes/kuber-apiserver-flag.html">
            
                <a href="../kubernetes/kuber-apiserver-flag.html">
            
                    
                        <b>1.9.21.</b>
                    
                    Kuber Apiserver Flag
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.22" data-path="../kubernetes/kubernetes-client.html">
            
                <a href="../kubernetes/kubernetes-client.html">
            
                    
                        <b>1.9.22.</b>
                    
                    Kubernetes Client
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.23" data-path="../kubernetes/kubernetes灾备.html">
            
                <a href="../kubernetes/kubernetes灾备.html">
            
                    
                        <b>1.9.23.</b>
                    
                    Kubernetes灾备
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.24" data-path="../kubernetes/kubesphere/">
            
                <a href="../kubernetes/kubesphere/">
            
                    
                        <b>1.9.24.</b>
                    
                    Kubesphere
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.9.24.1" data-path="../kubernetes/kubesphere/helm.html">
            
                <a href="../kubernetes/kubesphere/helm.html">
            
                    
                        <b>1.9.24.1.</b>
                    
                    Helm
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.24.2" data-path="../kubernetes/kubesphere/readme.html">
            
                <a href="../kubernetes/kubesphere/readme.html">
            
                    
                        <b>1.9.24.2.</b>
                    
                    Readme
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.9.25" data-path="../kubernetes/kubevela/">
            
                <a href="../kubernetes/kubevela/">
            
                    
                        <b>1.9.25.</b>
                    
                    Kubevela
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.9.25.1" data-path="../kubernetes/kubevela/KubeVela 功能.html">
            
                <a href="../kubernetes/kubevela/KubeVela 功能.html">
            
                    
                        <b>1.9.25.1.</b>
                    
                    KubeVela 功能
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.25.2" data-path="../kubernetes/kubevela/cue.html">
            
                <a href="../kubernetes/kubevela/cue.html">
            
                    
                        <b>1.9.25.2.</b>
                    
                    Cue
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.25.3" data-path="../kubernetes/kubevela/oam.html">
            
                <a href="../kubernetes/kubevela/oam.html">
            
                    
                        <b>1.9.25.3.</b>
                    
                    Oam
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.25.4" data-path="../kubernetes/kubevela/readme.html">
            
                <a href="../kubernetes/kubevela/readme.html">
            
                    
                        <b>1.9.25.4.</b>
                    
                    Readme
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.25.5" data-path="../kubernetes/kubevela/rollout design.html">
            
                <a href="../kubernetes/kubevela/rollout design.html">
            
                    
                        <b>1.9.25.5.</b>
                    
                    Rollout Design
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.25.6" data-path="../kubernetes/kubevela/vela run.html">
            
                <a href="../kubernetes/kubevela/vela run.html">
            
                    
                        <b>1.9.25.6.</b>
                    
                    Vela Run
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.25.7" data-path="../kubernetes/kubevela/vela up.html">
            
                <a href="../kubernetes/kubevela/vela up.html">
            
                    
                        <b>1.9.25.7.</b>
                    
                    Vela Up
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.25.8" data-path="../kubernetes/kubevela/vela-cluster.html">
            
                <a href="../kubernetes/kubevela/vela-cluster.html">
            
                    
                        <b>1.9.25.8.</b>
                    
                    Vela Cluster
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.25.9" data-path="../kubernetes/kubevela/vela-helm.html">
            
                <a href="../kubernetes/kubevela/vela-helm.html">
            
                    
                        <b>1.9.25.9.</b>
                    
                    Vela Helm
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.25.10" data-path="../kubernetes/kubevela/vela-pk-oam.html">
            
                <a href="../kubernetes/kubevela/vela-pk-oam.html">
            
                    
                        <b>1.9.25.10.</b>
                    
                    Vela Pk Oam
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.9.26" data-path="../kubernetes/mk-cert.html">
            
                <a href="../kubernetes/mk-cert.html">
            
                    
                        <b>1.9.26.</b>
                    
                    Mk Cert
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.27" data-path="../kubernetes/open_swagger-ui.html">
            
                <a href="../kubernetes/open_swagger-ui.html">
            
                    
                        <b>1.9.27.</b>
                    
                    Open Swagger Ui
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.28" data-path="../kubernetes/readme.html">
            
                <a href="../kubernetes/readme.html">
            
                    
                        <b>1.9.28.</b>
                    
                    Readme
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.29" data-path="../kubernetes/task/">
            
                <a href="../kubernetes/task/">
            
                    
                        <b>1.9.29.</b>
                    
                    Task
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.9.29.1" data-path="../kubernetes/task/HPA.html">
            
                <a href="../kubernetes/task/HPA.html">
            
                    
                        <b>1.9.29.1.</b>
                    
                    HPA
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.29.2" data-path="../kubernetes/task/kubectl patch.html">
            
                <a href="../kubernetes/task/kubectl patch.html">
            
                    
                        <b>1.9.29.2.</b>
                    
                    Kubectl Patch
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.29.3" data-path="../kubernetes/task/pod 信息注入.html">
            
                <a href="../kubernetes/task/pod 信息注入.html">
            
                    
                        <b>1.9.29.3.</b>
                    
                    Pod 信息注入
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.29.4" data-path="../kubernetes/task/pod 垂直扩缩容.html">
            
                <a href="../kubernetes/task/pod 垂直扩缩容.html">
            
                    
                        <b>1.9.29.4.</b>
                    
                    Pod 垂直扩缩容
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.29.5" data-path="../kubernetes/task/readme.html">
            
                <a href="../kubernetes/task/readme.html">
            
                    
                        <b>1.9.29.5.</b>
                    
                    Readme
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.29.6" data-path="../kubernetes/task/server-side-apply.html">
            
                <a href="../kubernetes/task/server-side-apply.html">
            
                    
                        <b>1.9.29.6.</b>
                    
                    Server Side Apply
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.29.7" data-path="../kubernetes/task/准入控制.html">
            
                <a href="../kubernetes/task/准入控制.html">
            
                    
                        <b>1.9.29.7.</b>
                    
                    准入控制
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.29.8" data-path="../kubernetes/task/聚合api.html">
            
                <a href="../kubernetes/task/聚合api.html">
            
                    
                        <b>1.9.29.8.</b>
                    
                    聚合Api
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.29.9" data-path="../kubernetes/task/资源预留配置.html">
            
                <a href="../kubernetes/task/资源预留配置.html">
            
                    
                        <b>1.9.29.9.</b>
                    
                    资源预留配置
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.9.30" data-path="../kubernetes/webhook.html">
            
                <a href="../kubernetes/webhook.html">
            
                    
                        <b>1.9.30.</b>
                    
                    Webhook
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.31" data-path="../kubernetes/一致性认证.html">
            
                <a href="../kubernetes/一致性认证.html">
            
                    
                        <b>1.9.31.</b>
                    
                    一致性认证
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.32" data-path="../kubernetes/专利名词.html">
            
                <a href="../kubernetes/专利名词.html">
            
                    
                        <b>1.9.32.</b>
                    
                    专利名词
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.33" data-path="../kubernetes/删除namespace.html">
            
                <a href="../kubernetes/删除namespace.html">
            
                    
                        <b>1.9.33.</b>
                    
                    删除Namespace
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.34" data-path="../kubernetes/简化多集群.html">
            
                <a href="../kubernetes/简化多集群.html">
            
                    
                        <b>1.9.34.</b>
                    
                    简化多集群
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.35" data-path="../kubernetes/网络插件/">
            
                <a href="../kubernetes/网络插件/">
            
                    
                        <b>1.9.35.</b>
                    
                    网络插件
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.9.35.1" data-path="../kubernetes/网络插件/calico.html">
            
                <a href="../kubernetes/网络插件/calico.html">
            
                    
                        <b>1.9.35.1.</b>
                    
                    Calico
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.35.2" data-path="../kubernetes/网络插件/cilium.html">
            
                <a href="../kubernetes/网络插件/cilium.html">
            
                    
                        <b>1.9.35.2.</b>
                    
                    Cilium
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.35.3" data-path="../kubernetes/网络插件/ebpf.html">
            
                <a href="../kubernetes/网络插件/ebpf.html">
            
                    
                        <b>1.9.35.3.</b>
                    
                    Ebpf
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.35.4" data-path="../kubernetes/网络插件/readme.html">
            
                <a href="../kubernetes/网络插件/readme.html">
            
                    
                        <b>1.9.35.4.</b>
                    
                    Readme
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.9.36" data-path="../kubernetes/镜像/">
            
                <a href="../kubernetes/镜像/">
            
                    
                        <b>1.9.36.</b>
                    
                    镜像
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.9.36.1" data-path="../kubernetes/镜像/Containerd Stargz Snapshotter.html">
            
                <a href="../kubernetes/镜像/Containerd Stargz Snapshotter.html">
            
                    
                        <b>1.9.36.1.</b>
                    
                    Containerd Stargz Snapshotter
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.36.2" data-path="../kubernetes/镜像/OCI.html">
            
                <a href="../kubernetes/镜像/OCI.html">
            
                    
                        <b>1.9.36.2.</b>
                    
                    OCI
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.36.3" data-path="../kubernetes/镜像/harbor/">
            
                <a href="../kubernetes/镜像/harbor/">
            
                    
                        <b>1.9.36.3.</b>
                    
                    Harbor
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.9.36.3.1" data-path="../kubernetes/镜像/harbor/readme.html">
            
                <a href="../kubernetes/镜像/harbor/readme.html">
            
                    
                        <b>1.9.36.3.1.</b>
                    
                    Readme
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.9.36.4" data-path="../kubernetes/镜像/readme.html">
            
                <a href="../kubernetes/镜像/readme.html">
            
                    
                        <b>1.9.36.4.</b>
                    
                    Readme
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.36.5" data-path="../kubernetes/镜像/自动构建镜像.html">
            
                <a href="../kubernetes/镜像/自动构建镜像.html">
            
                    
                        <b>1.9.36.5.</b>
                    
                    自动构建镜像
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.36.6" data-path="../kubernetes/镜像/镜像加速方案.html">
            
                <a href="../kubernetes/镜像/镜像加速方案.html">
            
                    
                        <b>1.9.36.6.</b>
                    
                    镜像加速方案
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.36.7" data-path="../kubernetes/镜像/镜像延迟加载技术解析.html">
            
                <a href="../kubernetes/镜像/镜像延迟加载技术解析.html">
            
                    
                        <b>1.9.36.7.</b>
                    
                    镜像延迟加载技术解析
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.10" data-path="../math/">
            
                <a href="../math/">
            
                    
                        <b>1.10.</b>
                    
                    Math
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.10.1" data-path="../math/readme.html">
            
                <a href="../math/readme.html">
            
                    
                        <b>1.10.1.</b>
                    
                    Readme
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.10.2" data-path="../math/泊松分布.html">
            
                <a href="../math/泊松分布.html">
            
                    
                        <b>1.10.2.</b>
                    
                    泊松分布
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.11" data-path="../效率/">
            
                <a href="../效率/">
            
                    
                        <b>1.11.</b>
                    
                    效率
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.11.1" data-path="../效率/cat.html">
            
                <a href="../效率/cat.html">
            
                    
                        <b>1.11.1.</b>
                    
                    Cat
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.2" data-path="../效率/docker volume clean.html">
            
                <a href="../效率/docker volume clean.html">
            
                    
                        <b>1.11.2.</b>
                    
                    Docker Volume Clean
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.3" data-path="../效率/git book.html">
            
                <a href="../效率/git book.html">
            
                    
                        <b>1.11.3.</b>
                    
                    Git Book
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.4" data-path="../效率/git.html">
            
                <a href="../效率/git.html">
            
                    
                        <b>1.11.4.</b>
                    
                    Git
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.5" data-path="../效率/linux command.html">
            
                <a href="../效率/linux command.html">
            
                    
                        <b>1.11.5.</b>
                    
                    Linux Command
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.6" data-path="../效率/linux 内核.html">
            
                <a href="../效率/linux 内核.html">
            
                    
                        <b>1.11.6.</b>
                    
                    Linux 内核
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.7" data-path="../效率/macos path.html">
            
                <a href="../效率/macos path.html">
            
                    
                        <b>1.11.7.</b>
                    
                    Macos Path
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.8" data-path="../效率/nfs.html">
            
                <a href="../效率/nfs.html">
            
                    
                        <b>1.11.8.</b>
                    
                    Nfs
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.9" data-path="../效率/nginx.html">
            
                <a href="../效率/nginx.html">
            
                    
                        <b>1.11.9.</b>
                    
                    Nginx
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.10" data-path="../效率/nginx2.html">
            
                <a href="../效率/nginx2.html">
            
                    
                        <b>1.11.10.</b>
                    
                    Nginx2
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.11" data-path="../效率/oauth2.html">
            
                <a href="../效率/oauth2.html">
            
                    
                        <b>1.11.11.</b>
                    
                    Oauth2
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.12" data-path="../效率/ovftool.html">
            
                <a href="../效率/ovftool.html">
            
                    
                        <b>1.11.12.</b>
                    
                    Ovftool
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.13" data-path="../效率/readme.html">
            
                <a href="../效率/readme.html">
            
                    
                        <b>1.11.13.</b>
                    
                    Readme
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.14" data-path="../效率/sed.html">
            
                <a href="../效率/sed.html">
            
                    
                        <b>1.11.14.</b>
                    
                    Sed
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.15" data-path="../效率/shell_judge.html">
            
                <a href="../效率/shell_judge.html">
            
                    
                        <b>1.11.15.</b>
                    
                    Shell Judge
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.16" data-path="../效率/sshpass.html">
            
                <a href="../效率/sshpass.html">
            
                    
                        <b>1.11.16.</b>
                    
                    Sshpass
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.17" data-path="../效率/telepresence.html">
            
                <a href="../效率/telepresence.html">
            
                    
                        <b>1.11.17.</b>
                    
                    Telepresence
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.18" data-path="../效率/typora.html">
            
                <a href="../效率/typora.html">
            
                    
                        <b>1.11.18.</b>
                    
                    Typora
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.19" data-path="../效率/url encode.html">
            
                <a href="../效率/url encode.html">
            
                    
                        <b>1.11.19.</b>
                    
                    Url Encode
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.20" data-path="../效率/vim.html">
            
                <a href="../效率/vim.html">
            
                    
                        <b>1.11.20.</b>
                    
                    Vim
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.21" data-path="../效率/yum.html">
            
                <a href="../效率/yum.html">
            
                    
                        <b>1.11.21.</b>
                    
                    Yum
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.22" data-path="../效率/内网穿透.html">
            
                <a href="../效率/内网穿透.html">
            
                    
                        <b>1.11.22.</b>
                    
                    内网穿透
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.23" data-path="../效率/科学上网.html">
            
                <a href="../效率/科学上网.html">
            
                    
                        <b>1.11.23.</b>
                    
                    科学上网
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.24" data-path="../效率/证书制作.html">
            
                <a href="../效率/证书制作.html">
            
                    
                        <b>1.11.24.</b>
                    
                    证书制作
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.12" >
            
                <span>
            
                    
                        <b>1.12.</b>
                    
                    杂谈
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.12.1" data-path="../杂谈/论好文章和烂文章.html">
            
                <a href="../杂谈/论好文章和烂文章.html">
            
                    
                        <b>1.12.1.</b>
                    
                    论好文章和烂文章
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.13" data-path="../测试/">
            
                <a href="../测试/">
            
                    
                        <b>1.13.</b>
                    
                    测试
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.13.1" data-path="../测试/ginkgo/">
            
                <a href="../测试/ginkgo/">
            
                    
                        <b>1.13.1.</b>
                    
                    Ginkgo
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.13.1.1" data-path="../测试/ginkgo/ginkgo.html">
            
                <a href="../测试/ginkgo/ginkgo.html">
            
                    
                        <b>1.13.1.1.</b>
                    
                    Ginkgo
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.13.1.2" data-path="../测试/ginkgo/ginkgo_cmd.html">
            
                <a href="../测试/ginkgo/ginkgo_cmd.html">
            
                    
                        <b>1.13.1.2.</b>
                    
                    Ginkgo Cmd
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.13.1.3" data-path="../测试/ginkgo/readme.html">
            
                <a href="../测试/ginkgo/readme.html">
            
                    
                        <b>1.13.1.3.</b>
                    
                    Readme
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.13.2" data-path="../测试/golang-test.html">
            
                <a href="../测试/golang-test.html">
            
                    
                        <b>1.13.2.</b>
                    
                    Golang Test
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.13.3" data-path="../测试/http测试.html">
            
                <a href="../测试/http测试.html">
            
                    
                        <b>1.13.3.</b>
                    
                    Http测试
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.13.4" data-path="../测试/readme.html">
            
                <a href="../测试/readme.html">
            
                    
                        <b>1.13.4.</b>
                    
                    Readme
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.13.5" data-path="../测试/其他功能.html">
            
                <a href="../测试/其他功能.html">
            
                    
                        <b>1.13.5.</b>
                    
                    其他功能
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.13.6" data-path="../测试/单元测试.html">
            
                <a href="../测试/单元测试.html">
            
                    
                        <b>1.13.6.</b>
                    
                    单元测试
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.13.7" data-path="../测试/单元测试2.html">
            
                <a href="../测试/单元测试2.html">
            
                    
                        <b>1.13.7.</b>
                    
                    单元测试2
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.13.8" data-path="../测试/基准测试.html">
            
                <a href="../测试/基准测试.html">
            
                    
                        <b>1.13.8.</b>
                    
                    基准测试
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.13.9" data-path="../测试/子测试与子基准测试.html">
            
                <a href="../测试/子测试与子基准测试.html">
            
                    
                        <b>1.13.9.</b>
                    
                    子测试与子基准测试
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.13.10" data-path="../测试/并行测试.html">
            
                <a href="../测试/并行测试.html">
            
                    
                        <b>1.13.10.</b>
                    
                    并行测试
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.13.11" data-path="../测试/质量检查/">
            
                <a href="../测试/质量检查/">
            
                    
                        <b>1.13.11.</b>
                    
                    质量检查
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.13.11.1" data-path="../测试/质量检查/Sonar.html">
            
                <a href="../测试/质量检查/Sonar.html">
            
                    
                        <b>1.13.11.1.</b>
                    
                    Sonar
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.13.11.2" data-path="../测试/质量检查/go_lint.html">
            
                <a href="../测试/质量检查/go_lint.html">
            
                    
                        <b>1.13.11.2.</b>
                    
                    Go Lint
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.13.11.3" data-path="../测试/质量检查/readme.html">
            
                <a href="../测试/质量检查/readme.html">
            
                    
                        <b>1.13.11.3.</b>
                    
                    Readme
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.14" data-path="./">
            
                <a href="./">
            
                    
                        <b>1.14.</b>
                    
                    规范
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.14.1" data-path="CodeReviewComments.html">
            
                <a href="CodeReviewComments.html">
            
                    
                        <b>1.14.1.</b>
                    
                    CodeReviewComments
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.14.2" data-path="git规范.html">
            
                <a href="git规范.html">
            
                    
                        <b>1.14.2.</b>
                    
                    Git规范
            
                </a>
            

            
        </li>
    
        <li class="chapter active" data-level="1.14.3" data-path="golang 代码规范.html">
            
                <a href="golang 代码规范.html">
            
                    
                        <b>1.14.3.</b>
                    
                    Golang 代码规范
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.14.4" data-path="readme.html">
            
                <a href="readme.html">
            
                    
                        <b>1.14.4.</b>
                    
                    Readme
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.14.5" data-path="代码走读.html">
            
                <a href="代码走读.html">
            
                    
                        <b>1.14.5.</b>
                    
                    代码走读
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.15" data-path="../设计模式/">
            
                <a href="../设计模式/">
            
                    
                        <b>1.15.</b>
                    
                    设计模式
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.15.1" data-path="../设计模式/readme.html">
            
                <a href="../设计模式/readme.html">
            
                    
                        <b>1.15.1.</b>
                    
                    Readme
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.15.2" data-path="../设计模式/创建模型/">
            
                <a href="../设计模式/创建模型/">
            
                    
                        <b>1.15.2.</b>
                    
                    创建模型
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.15.2.1" data-path="../设计模式/创建模型/readme.html">
            
                <a href="../设计模式/创建模型/readme.html">
            
                    
                        <b>1.15.2.1.</b>
                    
                    Readme
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.15.2.2" data-path="../设计模式/创建模型/创建者模型.html">
            
                <a href="../设计模式/创建模型/创建者模型.html">
            
                    
                        <b>1.15.2.2.</b>
                    
                    创建者模型
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.15.2.3" data-path="../设计模式/创建模型/单例模式.html">
            
                <a href="../设计模式/创建模型/单例模式.html">
            
                    
                        <b>1.15.2.3.</b>
                    
                    单例模式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.15.2.4" data-path="../设计模式/创建模型/原型模式.html">
            
                <a href="../设计模式/创建模型/原型模式.html">
            
                    
                        <b>1.15.2.4.</b>
                    
                    原型模式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.15.2.5" data-path="../设计模式/创建模型/工厂方法.html">
            
                <a href="../设计模式/创建模型/工厂方法.html">
            
                    
                        <b>1.15.2.5.</b>
                    
                    工厂方法
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.15.2.6" data-path="../设计模式/创建模型/抽象工厂.html">
            
                <a href="../设计模式/创建模型/抽象工厂.html">
            
                    
                        <b>1.15.2.6.</b>
                    
                    抽象工厂
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.15.2.7" data-path="../设计模式/创建模型/简单工厂.html">
            
                <a href="../设计模式/创建模型/简单工厂.html">
            
                    
                        <b>1.15.2.7.</b>
                    
                    简单工厂
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.15.3" data-path="../设计模式/结构型模型/">
            
                <a href="../设计模式/结构型模型/">
            
                    
                        <b>1.15.3.</b>
                    
                    结构型模型
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.15.3.1" data-path="../设计模式/结构型模型/readme.html">
            
                <a href="../设计模式/结构型模型/readme.html">
            
                    
                        <b>1.15.3.1.</b>
                    
                    Readme
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.15.3.2" data-path="../设计模式/结构型模型/享元模式.html">
            
                <a href="../设计模式/结构型模型/享元模式.html">
            
                    
                        <b>1.15.3.2.</b>
                    
                    享元模式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.15.3.3" data-path="../设计模式/结构型模型/代理模式.html">
            
                <a href="../设计模式/结构型模型/代理模式.html">
            
                    
                        <b>1.15.3.3.</b>
                    
                    代理模式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.15.3.4" data-path="../设计模式/结构型模型/外观模式.html">
            
                <a href="../设计模式/结构型模型/外观模式.html">
            
                    
                        <b>1.15.3.4.</b>
                    
                    外观模式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.15.3.5" data-path="../设计模式/结构型模型/桥模式.html">
            
                <a href="../设计模式/结构型模型/桥模式.html">
            
                    
                        <b>1.15.3.5.</b>
                    
                    桥模式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.15.3.6" data-path="../设计模式/结构型模型/组合模式.html">
            
                <a href="../设计模式/结构型模型/组合模式.html">
            
                    
                        <b>1.15.3.6.</b>
                    
                    组合模式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.15.3.7" data-path="../设计模式/结构型模型/装饰模式.html">
            
                <a href="../设计模式/结构型模型/装饰模式.html">
            
                    
                        <b>1.15.3.7.</b>
                    
                    装饰模式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.15.3.8" data-path="../设计模式/结构型模型/适配器模式.html">
            
                <a href="../设计模式/结构型模型/适配器模式.html">
            
                    
                        <b>1.15.3.8.</b>
                    
                    适配器模式
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.15.4" data-path="../设计模式/行为型模型/">
            
                <a href="../设计模式/行为型模型/">
            
                    
                        <b>1.15.4.</b>
                    
                    行为型模型
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.15.4.1" data-path="../设计模式/行为型模型/readme.html">
            
                <a href="../设计模式/行为型模型/readme.html">
            
                    
                        <b>1.15.4.1.</b>
                    
                    Readme
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.15.4.2" data-path="../设计模式/行为型模型/中介者模式.html">
            
                <a href="../设计模式/行为型模型/中介者模式.html">
            
                    
                        <b>1.15.4.2.</b>
                    
                    中介者模式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.15.4.3" data-path="../设计模式/行为型模型/命令模式.html">
            
                <a href="../设计模式/行为型模型/命令模式.html">
            
                    
                        <b>1.15.4.3.</b>
                    
                    命令模式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.15.4.4" data-path="../设计模式/行为型模型/备忘录模式.html">
            
                <a href="../设计模式/行为型模型/备忘录模式.html">
            
                    
                        <b>1.15.4.4.</b>
                    
                    备忘录模式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.15.4.5" data-path="../设计模式/行为型模型/模板方法模式.html">
            
                <a href="../设计模式/行为型模型/模板方法模式.html">
            
                    
                        <b>1.15.4.5.</b>
                    
                    模板方法模式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.15.4.6" data-path="../设计模式/行为型模型/状态模式.html">
            
                <a href="../设计模式/行为型模型/状态模式.html">
            
                    
                        <b>1.15.4.6.</b>
                    
                    状态模式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.15.4.7" data-path="../设计模式/行为型模型/策略模式.html">
            
                <a href="../设计模式/行为型模型/策略模式.html">
            
                    
                        <b>1.15.4.7.</b>
                    
                    策略模式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.15.4.8" data-path="../设计模式/行为型模型/职责链模式.html">
            
                <a href="../设计模式/行为型模型/职责链模式.html">
            
                    
                        <b>1.15.4.8.</b>
                    
                    职责链模式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.15.4.9" data-path="../设计模式/行为型模型/观察者模式.html">
            
                <a href="../设计模式/行为型模型/观察者模式.html">
            
                    
                        <b>1.15.4.9.</b>
                    
                    观察者模式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.15.4.10" data-path="../设计模式/行为型模型/解释器模式.html">
            
                <a href="../设计模式/行为型模型/解释器模式.html">
            
                    
                        <b>1.15.4.10.</b>
                    
                    解释器模式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.15.4.11" data-path="../设计模式/行为型模型/访问者模式.html">
            
                <a href="../设计模式/行为型模型/访问者模式.html">
            
                    
                        <b>1.15.4.11.</b>
                    
                    访问者模式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.15.4.12" data-path="../设计模式/行为型模型/迭代器模式.html">
            
                <a href="../设计模式/行为型模型/迭代器模式.html">
            
                    
                        <b>1.15.4.12.</b>
                    
                    迭代器模式
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

            </ul>
            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            本书使用 GitBook 发布
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href="../.." >Golang 代码规范</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <div id="anchor-navigation-ex-navbar"><i class="fa fa-anchor"></i><ul><li><a href="#golang&#x3000;&#x4EE3;&#x7801;&#x89C4;&#x8303;">Golang&#x3000;&#x4EE3;&#x7801;&#x89C4;&#x8303;</a></li><ul><li><a href="#&#x4EE3;&#x7801;&#x8D70;&#x8BFB;&#x68C0;&#x67E5;&#x70B9;">&#x4EE3;&#x7801;&#x8D70;&#x8BFB;&#x68C0;&#x67E5;&#x70B9;</a></li><ul><li><a href="#&#x68C0;&#x67E5;&#x4E1A;&#x52A1;&#x903B;&#x8F91;">&#x68C0;&#x67E5;&#x4E1A;&#x52A1;&#x903B;&#x8F91;</a></li><li><a href="#&#x5F02;&#x5E38;&#x573A;&#x666F;&#x662F;&#x5426;&#x8003;&#x8651;&#x5B8C;&#x5168;">&#x5F02;&#x5E38;&#x573A;&#x666F;&#x662F;&#x5426;&#x8003;&#x8651;&#x5B8C;&#x5168;</a></li><li><a href="#goroutine-&#x662F;&#x5426;&#x5B58;&#x5728;&#x5185;&#x5B58;&#x6CC4;&#x6F0F;">goroutine &#x662F;&#x5426;&#x5B58;&#x5728;&#x5185;&#x5B58;&#x6CC4;&#x6F0F;</a></li><li><a href="#&#x662F;&#x5426;&#x5B58;&#x5728;&#x8FC7;&#x591A;&#x7684;&#x91CD;&#x590D;&#x4EE3;&#x7801;&#xFF0C;&#x53EF;&#x4EE5;&#x62BD;&#x8C61;">&#x662F;&#x5426;&#x5B58;&#x5728;&#x8FC7;&#x591A;&#x7684;&#x91CD;&#x590D;&#x4EE3;&#x7801;&#xFF0C;&#x53EF;&#x4EE5;&#x62BD;&#x8C61;</a></li><li><a href="#&#x5E76;&#x53D1;&#x64CD;&#x4F5C;&#x662F;&#x5426;&#x5B89;&#x5168;">&#x5E76;&#x53D1;&#x64CD;&#x4F5C;&#x662F;&#x5426;&#x5B89;&#x5168;</a></li><li><a href="#&#x6570;&#x636E;&#x5E93;&#x64CD;&#x4F5C;">&#x6570;&#x636E;&#x5E93;&#x64CD;&#x4F5C;</a></li></ul></ul></ul></div><a href="#golang&#x3000;&#x4EE3;&#x7801;&#x89C4;&#x8303;" id="anchorNavigationExGoTop"><i class="fa fa-arrow-up"></i></a><!-- toc -->
<ul>
<li><a href="#golang%E3%80%80%E4%BB%A3%E7%A0%81%E8%A7%84%E8%8C%83">Golang&#x3000;&#x4EE3;&#x7801;&#x89C4;&#x8303;</a><ul>
<li><a href="#%E6%B3%A8%E9%87%8A%E8%AF%AD%E5%8F%A5">&#x6CE8;&#x91CA;&#x8BED;&#x53E5;</a></li>
<li><a href="#%E5%8C%85%E7%9A%84%E6%B3%A8%E9%87%8A">&#x5305;&#x7684;&#x6CE8;&#x91CA;</a></li>
<li><a href="#%E5%91%BD%E5%90%8D%E8%A7%84%E8%8C%83">&#x547D;&#x540D;&#x89C4;&#x8303;</a></li>
<li><a href="#%E9%94%99%E8%AF%AF%E5%A4%84%E7%90%86">&#x9519;&#x8BEF;&#x5904;&#x7406;</a></li>
<li><a href="#gofmt">Gofmt</a></li>
<li><a href="#%E6%96%B9%E6%B3%95%E8%A7%84%E8%8C%83">&#x65B9;&#x6CD5;&#x89C4;&#x8303;</a></li>
<li><a href="#%E5%8C%85%E7%AE%A1%E7%90%86">&#x5305;&#x7BA1;&#x7406;</a></li>
<li><a href="#%E5%8D%95%E5%85%83%E6%B5%8B%E8%AF%95">&#x5355;&#x5143;&#x6D4B;&#x8BD5;</a></li>
<li><a href="#%E9%A1%B9%E7%9B%AE%E5%AE%8C%E6%95%B4%E6%80%A7">&#x9879;&#x76EE;&#x5B8C;&#x6574;&#x6027;</a></li>
<li><a href="#goroutine-%E7%94%9F%E5%91%BD%E5%91%A8%E6%9C%9F">Goroutine &#x751F;&#x547D;&#x5468;&#x671F;</a></li>
<li><a href="#%E7%A9%BA%E5%88%87%E7%89%87">&#x7A7A;&#x5207;&#x7247;</a></li>
<li><a href="#%E4%BC%A0%E5%80%BC">&#x4F20;&#x503C;</a></li>
<li><a href="#contexts">Contexts</a></li>
<li><a href="#receiver">Receiver</a></li>
<li><a href="#%E4%BD%BF%E7%94%A8crypto-rand%E7%94%9F%E6%88%90%E9%9A%8F%E6%9C%BA%E5%80%BC">&#x4F7F;&#x7528;crypto rand&#x751F;&#x6210;&#x968F;&#x673A;&#x503C;</a><ul>
<li><a href="#%E4%BB%A3%E7%A0%81%E8%B5%B0%E8%AF%BB%E6%A3%80%E6%9F%A5%E7%82%B9">&#x4EE3;&#x7801;&#x8D70;&#x8BFB;&#x68C0;&#x67E5;&#x70B9;</a></li>
</ul>
</li>
<li><a href="#%E6%A3%80%E6%9F%A5%E4%B8%9A%E5%8A%A1%E9%80%BB%E8%BE%91">&#x68C0;&#x67E5;&#x4E1A;&#x52A1;&#x903B;&#x8F91;</a></li>
<li><a href="#%E5%BC%82%E5%B8%B8%E5%9C%BA%E6%99%AF%E6%98%AF%E5%90%A6%E8%80%83%E8%99%91%E5%AE%8C%E5%85%A8">&#x5F02;&#x5E38;&#x573A;&#x666F;&#x662F;&#x5426;&#x8003;&#x8651;&#x5B8C;&#x5168;</a></li>
<li><a href="#goroutine-%E6%98%AF%E5%90%A6%E5%AD%98%E5%9C%A8%E5%86%85%E5%AD%98%E6%B3%84%E6%BC%8F">goroutine &#x662F;&#x5426;&#x5B58;&#x5728;&#x5185;&#x5B58;&#x6CC4;&#x6F0F;</a></li>
<li><a href="#%E6%98%AF%E5%90%A6%E5%AD%98%E5%9C%A8%E8%BF%87%E5%A4%9A%E7%9A%84%E9%87%8D%E5%A4%8D%E4%BB%A3%E7%A0%81%E5%8F%AF%E4%BB%A5%E6%8A%BD%E8%B1%A1">&#x662F;&#x5426;&#x5B58;&#x5728;&#x8FC7;&#x591A;&#x7684;&#x91CD;&#x590D;&#x4EE3;&#x7801;&#xFF0C;&#x53EF;&#x4EE5;&#x62BD;&#x8C61;</a></li>
<li><a href="#%E5%B9%B6%E5%8F%91%E6%93%8D%E4%BD%9C%E6%98%AF%E5%90%A6%E5%AE%89%E5%85%A8">&#x5E76;&#x53D1;&#x64CD;&#x4F5C;&#x662F;&#x5426;&#x5B89;&#x5168;</a></li>
<li><a href="#%E6%95%B0%E6%8D%AE%E5%BA%93%E6%93%8D%E4%BD%9C">&#x6570;&#x636E;&#x5E93;&#x64CD;&#x4F5C;</a></li>
</ul>
</li>
</ul>
<!-- tocstop -->
<h1 id="golang&#x3000;&#x4EE3;&#x7801;&#x89C4;&#x8303;"><a name="golang&#x3000;&#x4EE3;&#x7801;&#x89C4;&#x8303;" class="anchor-navigation-ex-anchor" href="#golang&#x3000;&#x4EE3;&#x7801;&#x89C4;&#x8303;"><i class="fa fa-link" aria-hidden="true"></i></a>Golang&#x3000;&#x4EE3;&#x7801;&#x89C4;&#x8303;</h1>
<h3 id="&#x6CE8;&#x91CA;&#x8BED;&#x53E5;"><a name="&#x6CE8;&#x91CA;&#x8BED;&#x53E5;" class="anchor-navigation-ex-anchor" href="#&#x6CE8;&#x91CA;&#x8BED;&#x53E5;"><i class="fa fa-link" aria-hidden="true"></i></a>&#x6CE8;&#x91CA;&#x8BED;&#x53E5;</h3>
<p>  &#x53C2;&#x8003; [<a href="https://golang.org/doc/effective_go.html#commentary" target="_blank">https://golang.org/doc/effective_go.html#commentary</a>] </p>
<p>  &#x6240;&#x6709;&#x5BFC;&#x51FA;&#x7684;&#x540D;&#x79F0;&#x3001;&#x51FD;&#x6570;&#x58F0;&#x660E;&#x3001;&#x7ED3;&#x6784;&#x58F0;&#x660E;&#x7B49;&#x90FD;&#x5E94;&#x8BE5;&#x6709;&#x6CE8;&#x91CA;  </p>
<p>  Go&#x8BED;&#x8A00;&#x63D0;&#x4F9B;C&#x98CE;&#x683C;&#x7684;<code>/* */</code>&#x5757;&#x6CE8;&#x91CA;&#x548C;C++&#x98CE;&#x683C;&#x7684;<code>//</code>&#x884C;&#x6CE8;&#x91CA;&#x3002;</p>
<p>  &#x5305;&#x5E94;&#x8BE5;&#x6709;&#x4E00;&#x4E2A;&#x5305;&#x6CE8;&#x91CA;&#xFF0C;&#x5BF9;&#x4E8E;&#x591A;&#x6587;&#x4EF6;&#x5305;&#xFF0C;&#x6CE8;&#x91CA;&#x53EA;&#x9700;&#x8981;&#x51FA;&#x73B0;&#x5728;&#x4EFB;&#x610F;&#x4E00;&#x4E2A;&#x6587;&#x4EF6;&#x4E2D;&#x3002;&#x5305;&#x6CE8;&#x91CA;&#x5E94;&#x5F53;&#x63D0;&#x4F9B;&#x6574;&#x4E2A;&#x5305;&#x76F8;&#x5173;&#x7684;&#x4FE1;&#x606F;&#x3002;</p>
<p>  &#x6CE8;&#x91CA;&#x7684;&#x53E5;&#x5B50;&#x5E94;&#x5F53;&#x5177;&#x6709;&#x5B8C;&#x6574;&#x6027;&#xFF0C;&#x8FD9;&#x4F7F;&#x5F97;&#x5B83;&#x4EEC;&#x5728;&#x63D0;&#x53D6;&#x5230;&#x6587;&#x6863;&#x65F6;&#x80FD;&#x4FDD;&#x6301;&#x826F;&#x597D;&#x7684;&#x683C;&#x5F0F;&#x3002;&#x4F7F;&#x7528;godoc&#x65F6;&#x5305;&#x6CE8;&#x91CA;&#x5C06;&#x4E0E;&#x58F0;&#x660E;&#x4E00;&#x8D77;&#x63D0;&#x53D6;&#xFF0C;&#x4F5C;&#x4E3A;&#x9879;&#x76EE;&#x7684;&#x89E3;&#x91CA;&#x6027;&#x6587;&#x672C;&#x3002;&#x8FD9;&#x4E9B;&#x6CE8;&#x91CA;&#x7684;&#x98CE;&#x683C;&#x548C;&#x5185;&#x5BB9;&#x51B3;&#x5B9A;&#x4E86;&#x6587;&#x6863;&#x7684;&#x8D28;&#x91CF;&#x3002;</p>
<p>  &#x6CE8;&#x91CA;&#x5E94;&#x5F53;&#x4EE5;&#x63CF;&#x8FF0;&#x7684;&#x4E8B;&#x7269;&#x540D;&#x79F0;&#x5F00;&#x5934;&#xFF0C;&#x4EE5;&#x53E5;&#x70B9;&#xFF08;&#x6216;&#x8005; ! ? &#xFF09;&#x7ED3;&#x675F;&#x3002;</p>
<p>  &#x53C2;&#x8003;&#x4EE5;&#x4E0B;&#x683C;&#x5F0F;&#xFF1A;</p>
<pre class="language-"><code class="lang-go"><span class="token comment">// Request represents a request to run a command.</span>
<span class="token keyword">type</span> Request <span class="token keyword">struct</span> <span class="token punctuation">{</span> <span class="token operator">...</span>

<span class="token comment">// Encode writes the JSON encoding of req to w.</span>
<span class="token keyword">func</span> <span class="token function">Encode</span><span class="token punctuation">(</span>w io<span class="token punctuation">.</span>Writer<span class="token punctuation">,</span> req <span class="token operator">*</span>Request<span class="token punctuation">)</span> <span class="token punctuation">{</span> <span class="token operator">...</span>
</code></pre>
<pre class="language-"><code class="lang-go"><span class="token comment">/*
Package regexp implements a simple library for regular expressions.

The syntax of the regular expressions accepted is:

    regexp:
        concatenation { &apos;|&apos; concatenation }
    concatenation:
        { closure }
    closure:
        term [ &apos;*&apos; | &apos;+&apos; | &apos;?&apos; ]
    term:
        &apos;^&apos;
        &apos;$&apos;
        &apos;.&apos;
        character
        &apos;[&apos; [ &apos;^&apos; ] character-ranges &apos;]&apos;
        &apos;(&apos; regexp &apos;)&apos;
*/</span>
<span class="token keyword">package</span> regexp
</code></pre>
<h3 id="&#x5305;&#x7684;&#x6CE8;&#x91CA;"><a name="&#x5305;&#x7684;&#x6CE8;&#x91CA;" class="anchor-navigation-ex-anchor" href="#&#x5305;&#x7684;&#x6CE8;&#x91CA;"><i class="fa fa-link" aria-hidden="true"></i></a>&#x5305;&#x7684;&#x6CE8;&#x91CA;</h3>
<p>&#x4E0E;godoc&#x5448;&#x73B0;&#x7684;&#x6240;&#x6709;&#x6CE8;&#x91CA;&#x4E00;&#x6837;&#xFF0C;&#x5305;&#x7684;&#x6CE8;&#x91CA;&#x5FC5;&#x987B;&#x51FA;&#x73B0;&#x5728;package&#x5B50;&#x53E5;&#x7684;&#x65C1;&#x8FB9;&#xFF0C;&#x4E14;&#x4E0D;&#x5E26;&#x7A7A;&#x884C;&#xFF1A;</p>
<pre class="language-"><code class="lang-go"><span class="token comment">// Package math provides basic constants and mathematical functions.</span>
<span class="token keyword">package</span> math
</code></pre>
<pre class="language-"><code class="lang-go"><span class="token comment">/*
Package template implements data-driven templates for generating textual
output such as HTML.
....
*/</span>
<span class="token keyword">package</span> template
</code></pre>
<p>&#x5BF9;&#x4E8E;main&#x5305;&#x7684;&#x6CE8;&#x91CA;&#xFF0C;&#x5F88;&#x591A;&#x79CD;&#x6CE8;&#x91CA;&#x683C;&#x5F0F;&#x90FD;&#x662F;&#x53EF;&#x4EE5;&#x63A5;&#x53D7;&#x7684;&#xFF0C;&#x6BD4;&#x5982;&#x5728;&#x76EE;&#x5F55;<code>seedgen</code>&#x4E2D;&#x7684; <code>package main</code>&#x5305;&#xFF0C;&#x6CE8;&#x91CA;&#x53EF;&#x4EE5;&#x8FD9;&#x4E0B;&#x5199;:</p>
<pre class="language-"><code class="lang-go"><span class="token comment">// Binary seedgen ...</span>
<span class="token keyword">package</span> main
</code></pre>
<p>&#x6216;</p>
<pre class="language-"><code class="lang-go"><span class="token comment">// Command seedgen ...</span>
<span class="token keyword">package</span> main
</code></pre>
<p>or</p>
<pre class="language-"><code class="lang-go"><span class="token comment">// Program seedgen ...</span>
<span class="token keyword">package</span> main
</code></pre>
<p>&#x6216;</p>
<pre class="language-"><code class="lang-go"><span class="token comment">// The seedgen command ...</span>
<span class="token keyword">package</span> main
</code></pre>
<p>&#x6216;</p>
<pre class="language-"><code class="lang-go"><span class="token comment">// The seedgen program ...</span>
<span class="token keyword">package</span> main
</code></pre>
<p>&#x6216;</p>
<pre class="language-"><code class="lang-go"><span class="token comment">// Seedgen ..</span>
<span class="token keyword">package</span> main
</code></pre>
<p>&#x8BF7;&#x6CE8;&#x610F;&#xFF0C;&#x4EE5;&#x5C0F;&#x5199;&#x5B57;&#x6BCD;&#x5F00;&#x5934;&#x7684;&#x53E5;&#x5B50;&#x4E0D;&#x5728;&#x5305;&#x6CE8;&#x91CA;&#x7684;&#x53EF;&#x63A5;&#x53D7;&#x9009;&#x9879;&#x4E2D;&#xFF0C;&#x56E0;&#x4E3A;&#x5305;&#x662F;&#x516C;&#x5F00;&#x53EF;&#x89C1;&#x7684;&#xFF0C;&#x5E94;&#x5F53;&#x7528;&#x5408;&#x9002;&#x7684;&#x82F1;&#x8BED;&#x683C;&#x5F0F;&#x5199;&#x6210;&#xFF0C;&#x5305;&#x62EC;&#x5C06;&#x7B2C;&#x4E00;&#x4E2A;&#x8BCD;&#x9996;&#x5B57;&#x6BCD;&#x5927;&#x5199;&#x3002;</p>
<p><a href="https://golang.org/doc/effective_go.html#commentary" target="_blank">&#x83B7;&#x53D6;&#x66F4;&#x591A;&#x6709;&#x5173;&#x5305;&#x6CE8;&#x91CA;&#x7684;&#x89C4;&#x8303;</a></p>
<h3 id="&#x547D;&#x540D;&#x89C4;&#x8303;"><a name="&#x547D;&#x540D;&#x89C4;&#x8303;" class="anchor-navigation-ex-anchor" href="#&#x547D;&#x540D;&#x89C4;&#x8303;"><i class="fa fa-link" aria-hidden="true"></i></a>&#x547D;&#x540D;&#x89C4;&#x8303;</h3>
<p>&#x539F;&#x5219;&#xFF1A;&#x3000;&#x89C1;&#x540D;&#x77E5;&#x610F;&#xFF0C;&#x77ED;&#x5C0F;&#x7CBE;&#x608D;&#xFF0C;&#x4E0D;&#x5141;&#x8BB8;&#x5728;&#x547D;&#x540D;&#x65F6;&#x4E2D;&#x4F7F;&#x7528;@&#x3001;$&#x548C;%&#x7B49;&#x6807;&#x70B9;&#x7B26;&#x53F7;</p>
<p><strong>&#x51FD;&#x6570;&#x547D;&#x540D;&#xFF1A;</strong></p>
<ul>
<li>&#x9A7C;&#x5CF0;&#x89C4;&#x5219;</li>
</ul>
<p><strong>&#x7ED3;&#x6784;&#x4F53;&#xFF1A;</strong></p>
<ul>
<li>&#x91C7;&#x7528;&#x9A7C;&#x5CF0;&#x547D;&#x540D;&#x6CD5;&#xFF0C;&#x9996;&#x5B57;&#x6BCD;&#x6839;&#x636E;&#x8BBF;&#x95EE;&#x63A7;&#x5236;&#x5927;&#x5199;&#x6216;&#x8005;&#x5C0F;&#x5199;</li>
</ul>
<p><strong>&#x5305;&#x540D;:</strong></p>
<ul>
<li>&#x4FDD;&#x6301;package&#x7684;&#x540D;&#x5B57;&#x548C;&#x76EE;&#x5F55;&#x4FDD;&#x6301;&#x4E00;&#x81F4;&#xFF0C;&#x5C3D;&#x91CF;&#x91C7;&#x53D6;&#x6709;&#x610F;&#x4E49;&#x7684;&#x5305;&#x540D;&#xFF0C;&#x7B80;&#x77ED;&#xFF0C;&#x6709;&#x610F;&#x4E49;&#xFF0C;&#x5C3D;&#x91CF;&#x548C;&#x6807;&#x51C6;&#x5E93;&#x4E0D;&#x8981;&#x51B2;&#x7A81;&#x3002;</li>
<li>&#x5305;&#x540D;&#x5E94;&#x8BE5;&#x4E3A;&#x5C0F;&#x5199;&#x5355;&#x8BCD;&#xFF0C;&#x4E0D;&#x8981;&#x4F7F;&#x7528;&#x4E0B;&#x5212;&#x7EBF;&#x6216;&#x8005;&#x6DF7;&#x5408;&#x5927;&#x5C0F;&#x5199;&#x3002;</li>
</ul>
<p><strong>&#x6587;&#x4EF6;&#x547D;&#x540D;:</strong></p>
<ul>
<li>&#x5C3D;&#x91CF;&#x91C7;&#x53D6;&#x6709;&#x610F;&#x4E49;&#x7684;&#x6587;&#x4EF6;&#x540D;&#xFF0C;&#x7B80;&#x77ED;&#xFF0C;&#x6709;&#x610F;&#x4E49;&#xFF0C;&#x5E94;&#x8BE5;&#x4E3A;&#x5C0F;&#x5199;&#x5355;&#x8BCD;</li>
<li>&#x4F7F;&#x7528;&#x4E0B;&#x5212;&#x7EBF;&#x5206;&#x9694;&#x5404;&#x4E2A;&#x5355;&#x8BCD;&#x3002;</li>
</ul>
<p><strong>&#x63A5;&#x53E3;&#x547D;&#x540D;:</strong></p>
<ul>
<li>&#x547D;&#x540D;&#x89C4;&#x5219;&#x57FA;&#x672C;&#x548C;&#x4E0A;&#x9762;&#x7684;&#x7ED3;&#x6784;&#x4F53;&#x7C7B;&#x578B;&#x76F8;&#x540C;</li>
<li>&#x5355;&#x4E2A;&#x51FD;&#x6570;&#x7684;&#x7ED3;&#x6784;&#x540D;&#x4EE5; &#x201C;er&#x201D; &#x4F5C;&#x4E3A;&#x540E;&#x7F00;&#xFF0C;&#x4F8B;&#x5982; Reader , Writer </li>
</ul>
<p><strong>&#x5E38;&#x91CF;:</strong></p>
<ul>
<li>&#x5E38;&#x91CF;&#x5747;&#x9700;&#x4F7F;&#x7528;&#x5168;&#x90E8;&#x5927;&#x5199;&#x5B57;&#x6BCD;&#x7EC4;&#x6210;&#xFF0C;&#x5E76;&#x4F7F;&#x7528;&#x4E0B;&#x5212;&#x7EBF;&#x5206;&#x8BCD;</li>
</ul>
<p><strong>&#x53D8;&#x91CF;:</strong></p>
<p>&#x548C;&#x7ED3;&#x6784;&#x4F53;&#x7C7B;&#x4F3C;&#xFF0C;&#x53D8;&#x91CF;&#x540D;&#x79F0;&#x4E00;&#x822C;&#x9075;&#x5FAA;&#x9A7C;&#x5CF0;&#x6CD5;&#xFF0C;&#x9996;&#x5B57;&#x6BCD;&#x6839;&#x636E;&#x8BBF;&#x95EE;&#x63A7;&#x5236;&#x539F;&#x5219;&#x5927;&#x5199;&#x6216;&#x8005;&#x5C0F;&#x5199;&#xFF0C;&#x4F46;&#x9047;&#x5230;&#x7279;&#x6709;&#x540D;&#x8BCD;&#x65F6;&#xFF0C;&#x9700;&#x8981;&#x9075;&#x5FAA;&#x4EE5;&#x4E0B;&#x89C4;&#x5219;&#xFF1A;</p>
<ul>
<li>&#x5982;&#x679C;&#x53D8;&#x91CF;&#x4E3A;&#x79C1;&#x6709;&#xFF0C;&#x4E14;&#x7279;&#x6709;&#x540D;&#x8BCD;&#x4E3A;&#x9996;&#x4E2A;&#x5355;&#x8BCD;&#xFF0C;&#x5219;&#x4F7F;&#x7528;&#x5C0F;&#x5199;&#xFF0C;&#x5982; apiClient</li>
<li>&#x5176;&#x5B83;&#x60C5;&#x51B5;&#x90FD;&#x5E94;&#x5F53;&#x4F7F;&#x7528;&#x8BE5;&#x540D;&#x8BCD;&#x539F;&#x6709;&#x7684;&#x5199;&#x6CD5;&#xFF0C;&#x5982; APIClient&#x3001;repoID&#x3001;UserID</li>
<li>&#x82E5;&#x53D8;&#x91CF;&#x7C7B;&#x578B;&#x4E3A; bool &#x7C7B;&#x578B;&#xFF0C;&#x5219;&#x540D;&#x79F0;&#x5E94;&#x4EE5; Has, Is, Can &#x6216; Allow &#x5F00;&#x5934;</li>
</ul>
<p><strong>&#x7EC4;&#x5408;&#x540D;</strong></p>
<ul>
<li>Go&#x8BED;&#x8A00;&#x51B3;&#x5B9A;&#x4F7F;&#x7528;MixedCaps&#x6216;mixedCaps&#x6765;&#x547D;&#x540D;&#x7531;&#x591A;&#x4E2A;&#x5355;&#x8BCD;&#x7EC4;&#x5408;&#x7684;&#x540D;&#x79F0;&#xFF0C;&#x800C;&#x4E0D;&#x662F;&#x4F7F;&#x7528;&#x4E0B;&#x5212;&#x7EBF;&#x6765;&#x8FDE;&#x63A5;&#x591A;&#x4E2A;&#x5355;&#x8BCD;&#x3002;&#x5373;&#x4F7F;&#x5B83;&#x6253;&#x7834;&#x4E86;&#x5176;&#x4ED6;&#x8BED;&#x8A00;&#x7684;&#x60EF;&#x4F8B;&#x3002;
&#x4F8B;&#x5982;&#xFF0C;&#x672A;&#x5BFC;&#x51FA;&#x7684;&#x5E38;&#x91CF;&#x540D;&#x4E3A;<code>maxLength</code> &#x800C;&#x4E0D;&#x662F;<code>MaxLength</code> &#x6216; <code>MAX_LENGTH</code>&#x3002;</li>
</ul>
<h3 id="&#x9519;&#x8BEF;&#x5904;&#x7406;"><a name="&#x9519;&#x8BEF;&#x5904;&#x7406;" class="anchor-navigation-ex-anchor" href="#&#x9519;&#x8BEF;&#x5904;&#x7406;"><i class="fa fa-link" aria-hidden="true"></i></a>&#x9519;&#x8BEF;&#x5904;&#x7406;</h3>
<ul>
<li>&#x9519;&#x8BEF;&#x5904;&#x7406;&#x7684;&#x539F;&#x5219;&#x5C31;&#x662F;&#x4E0D;&#x80FD;&#x4E22;&#x5F03;&#x4EFB;&#x4F55;&#x6709;&#x8FD4;&#x56DE;err&#x7684;&#x8C03;&#x7528;&#xFF0C;&#x4E0D;&#x8981;&#x4F7F;&#x7528; _ &#x4E22;&#x5F03;&#xFF0C;&#x5FC5;&#x987B;&#x5168;&#x90E8;&#x5904;&#x7406;&#x3002;&#x63A5;&#x6536;&#x5230;&#x9519;&#x8BEF;&#xFF0C;&#x8981;&#x4E48;&#x8FD4;&#x56DE;err&#xFF0C;&#x6216;&#x8005;&#x4F7F;&#x7528;log&#x8BB0;&#x5F55;&#x4E0B;&#x6765;</li>
<li>&#x5C3D;&#x65E9;return&#xFF1A;&#x4E00;&#x65E6;&#x6709;&#x9519;&#x8BEF;&#x53D1;&#x751F;&#xFF0C;&#x9A6C;&#x4E0A;&#x8FD4;&#x56DE;</li>
<li>&#x5C3D;&#x91CF;&#x4E0D;&#x8981;&#x4F7F;&#x7528;panic&#xFF0C;&#x9664;&#x975E;&#x4F60;&#x77E5;&#x9053;&#x4F60;&#x5728;&#x505A;&#x4EC0;&#x4E48;</li>
<li>&#x9519;&#x8BEF;&#x63CF;&#x8FF0;&#x5982;&#x679C;&#x662F;&#x82F1;&#x6587;&#x5FC5;&#x987B;&#x4E3A;&#x5C0F;&#x5199;&#xFF0C;&#x4E0D;&#x9700;&#x8981;&#x6807;&#x70B9;&#x7ED3;&#x5C3E;</li>
<li>&#x91C7;&#x7528;&#x72EC;&#x7ACB;&#x7684;&#x9519;&#x8BEF;&#x6D41;&#x8FDB;&#x884C;&#x5904;&#x7406;</li>
</ul>
<h3 id="gofmt"><a name="gofmt" class="anchor-navigation-ex-anchor" href="#gofmt"><i class="fa fa-link" aria-hidden="true"></i></a>Gofmt</h3>
<p>  &#x4F60;&#x53EF;&#x4EE5;&#x5728;&#x4F60;&#x7684;&#x4EE3;&#x7801;&#x4E2D;&#x8FD0;&#x884C; <a href="https://golang.org/cmd/gofmt/" target="_blank">Gofmt</a> &#x4EE5;&#x89E3;&#x51B3;&#x5927;&#x591A;&#x6570;&#x4EE3;&#x7801;&#x683C;&#x5F0F;&#x95EE;&#x9898;&#x3002;&#x51E0;&#x4E4E;&#x6240;&#x6709;&#x7684;&#x4EE3;&#x7801;&#x90FD;&#x4F7F;&#x7528; <code>gofmt</code>&#x3002;&#x5982;&#x679C;&#x4F7F;&#x7528;<a href="https://github.com/visualfc/liteide" target="_blank">liteide</a>&#x7F16;&#x5199;Go&#x4EE3;&#x7801;&#x65F6;&#xFF0C;&#x4F7F;&#x7528;ctrl+s&#x5373;&#x53EF;&#x8C03;&#x7528;gofmt&#x3002;</p>
<p>  &#x53E6;&#x4E00;&#x79CD;&#x65B9;&#x6CD5;&#x662F;&#x4F7F;&#x7528; <a href="https://godoc.org/golang.org/x/tools/cmd/goimports" target="_blank">goimports</a>&#xFF0C;&#x5B83;&#x662F; <code>gofmt</code>&#x7684;&#x8D85;&#x96C6;&#xFF0C;&#x53EF;&#x6839;&#x636E;&#x9700;&#x8981;&#x6DFB;&#x52A0;&#xFF08;&#x5220;&#x9664;&#xFF09;&#x884C;&#x3002;</p>
<h3 id="&#x65B9;&#x6CD5;&#x89C4;&#x8303;"><a name="&#x65B9;&#x6CD5;&#x89C4;&#x8303;" class="anchor-navigation-ex-anchor" href="#&#x65B9;&#x6CD5;&#x89C4;&#x8303;"><i class="fa fa-link" aria-hidden="true"></i></a>&#x65B9;&#x6CD5;&#x89C4;&#x8303;</h3>
<ul>
<li>&#x5355;&#x4E00;&#x804C;&#x8D23;</li>
<li>&#x6CE8;&#x91CA;&#x65B9;&#x529F;&#x80FD;</li>
<li>&#x6CE8;&#x91CA;&#x53D8;&#x91CF;&#x548C;&#x8FD4;&#x56DE;&#x503C;</li>
<li>&#x5BF9;&#x4E8E;&#x4E00;&#x4E9B;&#x5173;&#x952E;&#x4F4D;&#x7F6E;&#x7684;&#x4EE3;&#x7801;&#x903B;&#x8F91;&#xFF0C;&#x6216;&#x8005;&#x5C40;&#x90E8;&#x8F83;&#x4E3A;&#x590D;&#x6742;&#x7684;&#x903B;&#x8F91;&#xFF0C;&#x9700;&#x8981;&#x6709;&#x76F8;&#x5E94;&#x7684;&#x903B;&#x8F91;&#x8BF4;&#x660E;&#xFF0C;&#x65B9;&#x4FBF;&#x5176;&#x4ED6;&#x5F00;&#x53D1;&#x8005;&#x9605;&#x8BFB;&#x8BE5;&#x6BB5;&#x4EE3;&#x7801;</li>
</ul>
<h3 id="&#x5305;&#x7BA1;&#x7406;"><a name="&#x5305;&#x7BA1;&#x7406;" class="anchor-navigation-ex-anchor" href="#&#x5305;&#x7BA1;&#x7406;"><i class="fa fa-link" aria-hidden="true"></i></a>&#x5305;&#x7BA1;&#x7406;</h3>
<p>&#x5C3D;&#x91CF;&#x907F;&#x514D;&#x5BFC;&#x5165;&#x5305;&#x65F6;&#x7684;&#x91CD;&#x547D;&#x540D;&#xFF0C;&#x4EE5;&#x907F;&#x514D;&#x540D;&#x79F0;&#x51B2;&#x7A81;&#x3002;&#x5982;&#x679C;&#x53D1;&#x751F;&#x540D;&#x79F0;&#x51B2;&#x7A81;&#xFF0C;&#x5C3D;&#x91CF;&#x91CD;&#x547D;&#x540D;&#x672C;&#x5730;&#x6216;&#x9879;&#x76EE;&#x7279;&#x5B9A;&#x7684;&#x5305;&#x3002;</p>
<p>&#x5BFC;&#x5165;&#x5305;&#x6309;&#x540D;&#x79F0;&#x5206;&#x7EC4;&#xFF0C;&#x7528;&#x7A7A;&#x884C;&#x9694;&#x5F00;&#x3002;</p>
<p>&#x6807;&#x51C6;&#x5E93;&#x5305;&#x5E94;&#x59CB;&#x7EC8;&#x4F4D;&#x4E8E;&#x7B2C;&#x4E00;&#x7EC4;&#x3002;</p>
<pre class="language-"><code class="lang-go"><span class="token keyword">package</span> main

<span class="token keyword">import</span> <span class="token punctuation">(</span>
    <span class="token string">&quot;fmt&quot;</span>
    <span class="token string">&quot;hash/adler32&quot;</span>
    <span class="token string">&quot;os&quot;</span>

    <span class="token string">&quot;appengine/foo&quot;</span>
    <span class="token string">&quot;appengine/user&quot;</span>

        <span class="token string">&quot;github.com/foo/bar&quot;</span>
    <span class="token string">&quot;rsc.io/goversion/version&quot;</span>
<span class="token punctuation">)</span>
</code></pre>
<p>&#x53EF;&#x4EE5;&#x4F7F;&#x7528; <a href="https://godoc.org/golang.org/x/tools/cmd/goimports" target="_blank">goimports</a> &#x6765;&#x89C4;&#x8303;&#x5305;&#x7684;&#x6392;&#x5E8F;&#x3002;</p>
<h3 id="&#x5355;&#x5143;&#x6D4B;&#x8BD5;"><a name="&#x5355;&#x5143;&#x6D4B;&#x8BD5;" class="anchor-navigation-ex-anchor" href="#&#x5355;&#x5143;&#x6D4B;&#x8BD5;"><i class="fa fa-link" aria-hidden="true"></i></a>&#x5355;&#x5143;&#x6D4B;&#x8BD5;</h3>
<p>&#x5355;&#x5143;&#x6D4B;&#x8BD5;&#x6587;&#x4EF6;&#x547D;&#x540D;&#x89C4;&#x8303;&#x3000;example_test.go</p>
<p>&#x6D4B;&#x8BD5;&#x7528;&#x4F8B;&#x7684;&#x51FD;&#x6570;&#x540D;&#x79F0;&#x5FC5;&#x987B;&#x4EE5;Test&#x5F00;&#x5934;</p>
<p>&#x4F7F;&#x7528;&#x6570;&#x7EC4;&#x5B58;&#x653E;&#x591A;&#x4E2A;&#x6D4B;&#x8BD5;&#x6761;&#x4EF6;&#x7ED3;&#x6784;&#x4F53;&#xFF0C;&#x7136;&#x540E;&#x904D;&#x5386;&#x6570;&#x7EC4;&#xFF0C;&#x65AD;&#x8A00;result vs except</p>
<p>&#x6D4B;&#x8BD5;&#x5931;&#x8D25;&#x65F6;&#x5E94;&#x5F53;&#x8FD4;&#x56DE;&#x6709;&#x6548;&#x7684;&#x9519;&#x8BEF;&#x4FE1;&#x606F;&#xFF0C;&#x8BF4;&#x660E;&#x9519;&#x8BEF;&#x5728;&#x54EA;&#xFF0C;&#x8F93;&#x5165;&#x662F;&#x4EC0;&#x4E48;&#xFF0C;&#x8F93;&#x51FA;&#x65F6;&#x4EC0;&#x4E48;&#xFF0C;&#x671F;&#x671B;&#x8F93;&#x51FA;&#x662F;&#x4EC0;&#x4E48;&#x3002;</p>
<p>&#x4E00;&#x4E2A;&#x5178;&#x578B;&#x7684;&#x6D4B;&#x8BD5;&#x6761;&#x4EF6;&#x5F62;&#x5982;&#xFF1A;</p>
<pre class="language-"><code class="lang-go"><span class="token keyword">if</span> got <span class="token operator">!=</span> tt<span class="token punctuation">.</span>want <span class="token punctuation">{</span>
    t<span class="token punctuation">.</span><span class="token function">Errorf</span><span class="token punctuation">(</span><span class="token string">&quot;Foo(%q) = %d; want %d&quot;</span><span class="token punctuation">,</span> tt<span class="token punctuation">.</span>in<span class="token punctuation">,</span> got<span class="token punctuation">,</span> tt<span class="token punctuation">.</span>want<span class="token punctuation">)</span> <span class="token comment">// or Fatalf, if test can&apos;t test anything more past this point</span>
<span class="token punctuation">}</span>
</code></pre>
<p>&#x8BF7;&#x6CE8;&#x610F;&#x6B64;&#x5904;&#x7684;&#x547D;&#x4EE4;&#x662F; <code>&#x5B9E;&#x9645;&#x7ED3;&#x679C; != &#x9884;&#x671F;&#x7ED3;&#x679C;</code>.&#x4E00;&#x4E9B;&#x6D4B;&#x8BD5;&#x6846;&#x67B6;&#x9F13;&#x52B1;&#x7A0B;&#x5E8F;&#x5458;&#x7F16;&#x5199;&#xFF1A; 0 != x, &quot;expected 0, got x&quot;&#xFF0C;go&#x5E76;&#x4E0D;&#x63A8;&#x8350;&#x3002;</p>
<p>&#x5728;&#x4EFB;&#x4F55;&#x60C5;&#x51B5;&#x4E0B;&#xFF0C;&#x60A8;&#x6709;&#x8D23;&#x4EFB;&#x63D0;&#x4F9B;&#x6709;&#x7528;&#x7684;&#x9519;&#x8BEF;&#x4FE1;&#x606F;&#xFF0C;&#x4EE5;&#x4FBF;&#x5C06;&#x6765;&#x8C03;&#x8BD5;&#x60A8;&#x7684;&#x4EE3;&#x7801;&#x3002;</p>
<h3 id="&#x9879;&#x76EE;&#x5B8C;&#x6574;&#x6027;"><a name="&#x9879;&#x76EE;&#x5B8C;&#x6574;&#x6027;" class="anchor-navigation-ex-anchor" href="#&#x9879;&#x76EE;&#x5B8C;&#x6574;&#x6027;"><i class="fa fa-link" aria-hidden="true"></i></a>&#x9879;&#x76EE;&#x5B8C;&#x6574;&#x6027;</h3>
<ul>
<li>&#x67B6;&#x6784;&#x8BBE;&#x8BA1;&#x6587;&#x6863;</li>
<li>&#x9879;&#x76EE;&#x529F;&#x80FD;</li>
<li>&#x7F16;&#x8BD1;&#x548C;&#x6253;&#x5305;&#x955C;&#x50CF;&#x7684;&#x811A;&#x672C;</li>
<li>&#x5FC5;&#x987B;&#x4F7F;&#x7528;go mod &#x8FDB;&#x884C;&#x7248;&#x672C;&#x63A7;&#x5236;</li>
</ul>
<h3 id="goroutine-&#x751F;&#x547D;&#x5468;&#x671F;"><a name="goroutine-&#x751F;&#x547D;&#x5468;&#x671F;" class="anchor-navigation-ex-anchor" href="#goroutine-&#x751F;&#x547D;&#x5468;&#x671F;"><i class="fa fa-link" aria-hidden="true"></i></a>Goroutine &#x751F;&#x547D;&#x5468;&#x671F;</h3>
<p>&#x5F53;&#x4F60;&#x9700;&#x8981;&#x4F7F;&#x7528;goruntines&#x65F6;&#xFF0C;&#x8BF7;&#x786E;&#x4FDD;&#x5B83;&#x4EEC;&#x4EC0;&#x4E48;&#x65F6;&#x5019;/&#x4EC0;&#x4E48;&#x6761;&#x4EF6;&#x4E0B;&#x9000;&#x51FA;&#x3002;</p>
<p>Goroutines&#x53EF;&#x80FD;&#x4F1A;&#x56E0;&#x963B;&#x585E;channel&#x7684;send&#x6216;&#x8005;receives&#x800C;&#x6CC4;&#x9732;,&#x5373;&#x4F7F;&#x88AB;&#x963B;&#x585E;&#x7684;&#x901A;&#x9053;&#x65E0;&#x6CD5;&#x8BBF;&#x95EE;&#xFF0C;&#x5783;&#x573E;&#x6536;&#x96C6;&#x5668;&#x4E5F;&#x4E0D;&#x4F1A;&#x7EC8;&#x6B62;goroutine&#x3002;</p>
<p>&#x5373;&#x4F7F;gorountine&#x6CA1;&#x6709;&#x6CC4;&#x9732;&#xFF0C;&#x5F53;&#x4E0D;&#x518D;&#x9700;&#x8981;&#x5B83;&#x4EEC;&#x65F6;&#x4ECD;&#x5728;&#x7EE7;&#x7EED;&#x8FD0;&#x884C;&#x4F1A;&#x5BFC;&#x81F4;&#x96BE;&#x4EE5;&#x8BCA;&#x65AD;&#x7684;&#x95EE;&#x9898;&#x3002;&#x5373;&#x4F7F;&#x5728;&#x4E0D;&#x9700;&#x8981;&#x7ED3;&#x679C;&#x540E;&#xFF0C;&#x4FEE;&#x6539;&#x6B63;&#x5728;&#x4F7F;&#x7528;&#x7684;&#x6570;&#x636E;&#x4E5F;&#x4F1A;&#x5BFC;&#x81F4;&#x6570;&#x636E;&#x7ADE;&#x4E89;&#x3002;</p>
<p>&#x5C3D;&#x91CF;&#x4FDD;&#x8BC1;&#x5E76;&#x53D1;&#x4EE3;&#x7801;&#x8DB3;&#x591F;&#x7B80;&#x5355;&#xFF0C;&#x4F7F;gorountine&#x7684;&#x751F;&#x547D;&#x5468;&#x671F;&#x66F4;&#x660E;&#x663E;&#x3002;&#x5982;&#x679C;&#x96BE;&#x4EE5;&#x505A;&#x5230;&#xFF0C;&#x8BF7;&#x8BB0;&#x5F55;gorountines&#x9000;&#x51FA;&#x7684;&#x65F6;&#x95F4;&#x548C;&#x539F;&#x56E0;&#x3002;</p>
<h3 id="&#x7A7A;&#x5207;&#x7247;"><a name="&#x7A7A;&#x5207;&#x7247;" class="anchor-navigation-ex-anchor" href="#&#x7A7A;&#x5207;&#x7247;"><i class="fa fa-link" aria-hidden="true"></i></a>&#x7A7A;&#x5207;&#x7247;</h3>
<p>&#x5F53;&#x58F0;&#x660E;&#x4E00;&#x4E2A;&#x7A7A;&#x5207;&#x7247;&#x65F6;&#xFF0C; &#x4F7F;&#x7528;</p>
<pre class="language-"><code class="lang-go"><span class="token keyword">var</span> t <span class="token punctuation">[</span><span class="token punctuation">]</span><span class="token builtin">string</span>
</code></pre>
<p>&#x800C;&#x4E0D;&#x662F;</p>
<pre class="language-"><code class="lang-go">t <span class="token operator">:=</span> <span class="token punctuation">[</span><span class="token punctuation">]</span><span class="token builtin">string</span><span class="token punctuation">{</span><span class="token punctuation">}</span>
</code></pre>
<h3 id="&#x4F20;&#x503C;"><a name="&#x4F20;&#x503C;" class="anchor-navigation-ex-anchor" href="#&#x4F20;&#x503C;"><i class="fa fa-link" aria-hidden="true"></i></a>&#x4F20;&#x503C;</h3>
<p>&#x4E0D;&#x8981;&#x4EC5;&#x4EC5;&#x4E3A;&#x4E86;&#x8282;&#x7701;&#x51E0;&#x4E2A;&#x5B57;&#x8282;&#x800C;&#x4F20;&#x6307;&#x9488;&#x7ED9;&#x51FD;&#x6570;&#x3002;&#x5982;&#x679C;&#x51FD;&#x6570;&#x4EC5;&#x4EC5;&#x5C06;&#x5176;&#x53C2;&#x6570;&quot;x&quot;&#x4F5C;&#x4E3A;<code>*x</code>&#x4F7F;&#x7528;&#xFF0C;&#x90A3;&#x4E48;&#x53C2;&#x6570;&#x5C31;&#x4E0D;&#x5E94;&#x8BE5;&#x662F;&#x6307;&#x9488;&#x3002;</p>
<p>&#x5E38;&#x89C1;&#x7684;&#x4F20;&#x6307;&#x9488;&#x7684;&#x60C5;&#x51B5;&#x6709;&#xFF1A;&#x4F20;&#x9012;&#x4E00;&#x4E2A;string&#x7684;&#x6307;&#x9488;&#x3001;&#x6307;&#x5411;&#x63A5;&#x53E3;&#x503C;(<code>*io.Reader</code>)&#x7684;&#x6307;&#x9488;;&#x8FD9;&#x4E24;&#x79CD;&#x60C5;&#x51B5;&#x4E0B;&#xFF0C;&#x503C;&#x672C;&#x8EAB;&#x90FD;&#x662F;&#x56FA;&#x5B9A;&#x7684;&#xFF0C;&#x53EF;&#x4EE5;&#x76F4;&#x63A5;&#x4F20;&#x9012;&#x3002;</p>
<p>&#x5BF9;&#x4E8E;&#x5927;&#x578B;&#x6570;&#x636E;&#x7ED3;&#x6784;&#xFF0C;&#x6216;&#x8005;&#x662F;&#x5C0F;&#x578B;&#x7684;&#x53EF;&#x80FD;&#x589E;&#x957F;&#x7684;&#x7ED3;&#x6784;&#xFF0C;&#x8BF7;&#x8003;&#x8651;&#x4F20;&#x6307;&#x9488;&#x3002;</p>
<p><a href="https://segmentfault.com/a/1190000013148775" target="_blank">goLang slice &#x548C; array&#x533A;&#x522B;</a></p>
<p>&#x66F4;&#x591A;&#x60C5;&#x51B5;&#x8BF7;&#x89C1; <a href="#receiver-type">Receiver Type</a></p>
<h3 id="contexts"><a name="contexts" class="anchor-navigation-ex-anchor" href="#contexts"><i class="fa fa-link" aria-hidden="true"></i></a>Contexts</h3>
<p>Go&#x63D0;&#x4F9B;&#x4E86;<code>context</code>&#x5305;&#x6765;&#x7BA1;&#x7406;gorountine&#x7684;&#x751F;&#x547D;&#x5468;&#x671F;&#x3002;</p>
<p><code>context.Context</code>&#x7C7B;&#x578B;&#x7684;&#x503C;&#x5305;&#x62EC;&#x4E86;&#x8DE8;API&#x548C;&#x8FDB;&#x7A0B;&#x8FB9;&#x754C;&#x7684;&#x5B89;&#x5168;&#x51ED;&#x8BC1;&#xFF0C;&#x8DDF;&#x8E2A;&#x4FE1;&#x606F;&#xFF0C;&#x7ED3;&#x675F;&#x65F6;&#x95F4;&#x548C;&#x53D6;&#x6D88;&#x4FE1;&#x53F7;&#x3002;</p>
<p>&#x4F7F;&#x7528;context&#x5305;&#x65F6;&#x8BF7;&#x9075;&#x5FAA;&#x4EE5;&#x4E0B;&#x89C4;&#x5219;&#xFF1A;</p>
<ul>
<li>&#x4E0D;&#x8981;&#x5C06; Contexts &#x653E;&#x5165;&#x7ED3;&#x6784;&#x4F53;&#xFF0C;context&#x5E94;&#x8BE5;&#x4F5C;&#x4E3A;&#x7B2C;&#x4E00;&#x4E2A;&#x53C2;&#x6570;&#x4F20;&#x5165;&#x3002; &#x4E0D;&#x8FC7;&#x4E5F;&#x6709;&#x4F8B;&#x5916;&#xFF0C;&#x51FD;&#x6570;&#x7B7E;&#x540D;(method signature)&#x5FC5;&#x987B;&#x4E0E;&#x6807;&#x51C6;&#x5E93;&#x6216;&#x8005;&#x7B2C;&#x4E09;&#x65B9;&#x5E93;&#x4E2D;&#x7684;&#x63A5;&#x53E3;&#x76F8;&#x5339;&#x914D;<pre class="language-"><code class="lang-go"><span class="token keyword">func</span> <span class="token function">F</span><span class="token punctuation">(</span>ctx context<span class="token punctuation">.</span>Context<span class="token punctuation">,</span> <span class="token comment">/* other arguments */</span><span class="token punctuation">)</span> <span class="token punctuation">{</span><span class="token punctuation">}</span>
</code></pre>
</li>
<li><p>&#x5373;&#x4F7F;&#x51FD;&#x6570;&#x5141;&#x8BB8;&#xFF0C;&#x4E5F;&#x4E0D;&#x8981;&#x4F20;&#x5165;nil&#x7684; Context&#x3002;&#x5982;&#x679C;&#x4E0D;&#x77E5;&#x9053;&#x7528;&#x54EA;&#x79CD; Context&#xFF0C;&#x53EF;&#x4EE5;&#x4F7F;&#x7528;context.TODO()</p>
</li>
<li><p>&#x4F7F;&#x7528;context&#x7684;Value&#x76F8;&#x5173;&#x65B9;&#x6CD5;&#x53EA;&#x5E94;&#x8BE5;&#x7528;&#x4E8E;&#x5728;&#x7A0B;&#x5E8F;&#x548C;&#x63A5;&#x53E3;&#x4E2D;&#x4F20;&#x9012;&#x7684;&#x548C;&#x8BF7;&#x6C42;&#x76F8;&#x5173;&#x7684;&#x5143;&#x6570;&#x636E;&#xFF0C;&#x4E0D;&#x8981;&#x7528;&#x5B83;&#x6765;&#x4F20;&#x9012;&#x4E00;&#x4E9B;&#x53EF;&#x9009;&#x7684;&#x53C2;&#x6570;</p>
</li>
<li><p>&#x76F8;&#x540C;&#x7684; Context &#x53EF;&#x4EE5;&#x4F20;&#x9012;&#x7ED9;&#x5171;&#x4EAB;&#x7ED3;&#x675F;&#x65F6;&#x95F4;&#x3001;&#x53D6;&#x6D88;&#x4FE1;&#x53F7;&#x3001;&#x5B89;&#x5168;&#x51ED;&#x8BC1;&#x548C;&#x7236;&#x8FDB;&#x7A0B;&#x8FFD;&#x8E2A;&#x7B49;&#x4FE1;&#x606F;&#x7684;&#x591A;&#x4E2A;goroutine&#xFF0C;Context &#x662F;&#x5E76;&#x53D1;&#x5B89;&#x5168;&#x7684;</p>
</li>
<li><p>&#x4ECE;&#x4E0D;&#x505A;&#x7279;&#x5B9A;&#x8BF7;&#x6C42;&#x7684;&#x51FD;&#x6570;&#x53EF;&#x4EE5;&#x4F7F;&#x7528; context.Background()&#xFF0C;&#x4F46;&#x5373;&#x4F7F;&#x60A8;&#x8BA4;&#x4E3A;&#x4E0D;&#x9700;&#x8981;&#xFF0C;&#x4E5F;&#x53EF;&#x4EE5;&#x5728;&#x4F20;&#x9012;Context&#x65F6;&#x4F7F;&#x7528;&#x9519;&#x8BEF;(error)&#x3002;&#x5982;&#x679C;&#x60A8;&#x6709;&#x5145;&#x5206;&#x7684;&#x7406;&#x7531;&#x8BA4;&#x4E3A;&#x66FF;&#x4EE3;&#x65B9;&#x6848;&#x662F;&#x9519;&#x8BEF;&#x7684;&#xFF0C;&#x90A3;&#x4E48;&#x53EA;&#x80FD;&#x76F4;&#x63A5;&#x4F7F;&#x7528;context.Background()</p>
</li>
<li><p>&#x4E0D;&#x8981;&#x5728;&#x51FD;&#x6570;&#x7B7E;&#x540D;&#x4E2D;&#x521B;&#x5EFA;Context&#x7C7B;&#x578B;&#x6216;&#x8005;&#x4F7F;&#x7528;Context&#x4EE5;&#x5916;&#x7684;&#x63A5;&#x53E3;&#x3002;</p>
</li>
</ul>
<p>&#x5B98;&#x65B9;&#x4F7F;&#x7528;context&#x7684;&#x4F8B;&#x5B50;&#xFF1A;</p>
<pre class="language-"><code class="lang-go"><span class="token keyword">package</span> main

<span class="token keyword">import</span> <span class="token punctuation">(</span>
    <span class="token string">&quot;context&quot;</span>
    <span class="token string">&quot;fmt&quot;</span>
    <span class="token string">&quot;time&quot;</span>
<span class="token punctuation">)</span>

<span class="token keyword">func</span> <span class="token function">main</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
    d <span class="token operator">:=</span> time<span class="token punctuation">.</span><span class="token function">Now</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">Add</span><span class="token punctuation">(</span><span class="token number">50</span> <span class="token operator">*</span> time<span class="token punctuation">.</span>Millisecond<span class="token punctuation">)</span>
    ctx<span class="token punctuation">,</span> cancel <span class="token operator">:=</span> context<span class="token punctuation">.</span><span class="token function">WithDeadline</span><span class="token punctuation">(</span>context<span class="token punctuation">.</span><span class="token function">Background</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">,</span> d<span class="token punctuation">)</span>

    <span class="token comment">// Even though ctx will be expired, it is good practice to call its</span>
    <span class="token comment">// cancelation function in any case. Failure to do so may keep the</span>
    <span class="token comment">// context and its parent alive longer than necessary.</span>
    <span class="token keyword">defer</span> <span class="token function">cancel</span><span class="token punctuation">(</span><span class="token punctuation">)</span>

    <span class="token keyword">select</span> <span class="token punctuation">{</span>
    <span class="token keyword">case</span> <span class="token operator">&lt;-</span>time<span class="token punctuation">.</span><span class="token function">After</span><span class="token punctuation">(</span><span class="token number">1</span> <span class="token operator">*</span> time<span class="token punctuation">.</span>Second<span class="token punctuation">)</span><span class="token punctuation">:</span>
        fmt<span class="token punctuation">.</span><span class="token function">Println</span><span class="token punctuation">(</span><span class="token string">&quot;overslept&quot;</span><span class="token punctuation">)</span>
    <span class="token keyword">case</span> <span class="token operator">&lt;-</span>ctx<span class="token punctuation">.</span><span class="token function">Done</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">:</span>
        fmt<span class="token punctuation">.</span><span class="token function">Println</span><span class="token punctuation">(</span>ctx<span class="token punctuation">.</span><span class="token function">Err</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
    <span class="token punctuation">}</span>
<span class="token punctuation">}</span>
</code></pre>
<h3 id="receiver"><a name="receiver" class="anchor-navigation-ex-anchor" href="#receiver"><i class="fa fa-link" aria-hidden="true"></i></a>Receiver</h3>
<h4 id="&#x540D;&#x79F0;"><a name="&#x540D;&#x79F0;" class="anchor-navigation-ex-anchor" href="#&#x540D;&#x79F0;"><i class="fa fa-link" aria-hidden="true"></i></a>&#x540D;&#x79F0;</h4>
<p>&#x65B9;&#x6CD5;receiver&#x7684;&#x540D;&#x79F0;&#x5E94;&#x8BE5;&#x53CD;&#x6620;&#x5176;&#x8EAB;&#x4EFD;&#xFF1B;&#x901A;&#x5E38;&#xFF0C;&#x5176;&#x7C7B;&#x578B;&#x7684;&#x4E00;&#x4E2A;&#x6216;&#x4E24;&#x4E2A;&#x5B57;&#x6BCD;&#x7F29;&#x5199;&#x5C31;&#x8DB3;&#x591F;&#x4E86;(&#x4F8B;&#x5982;&quot;client&quot;&#x7684;&quot;c&quot;&#x6216;&quot;cl&quot;)&#x3002;&#x8BF7;&#x4E0D;&#x8981;&#x4F7F;&#x7528;&#x901A;&#x7528;&#x540D;&#x79F0;&#x5982;&quot;me&quot;, &quot;this&quot; &#x6216; &quot;self&quot;&#x3002;&#x8BF7;&#x59CB;&#x7EC8;&#x4FDD;&#x6301;&#x540D;&#x79F0;&#x4E0D;&#x53D8;&#xFF0C;&#x5982;&#x679C;&#x4F60;&#x5728;&#x4E00;&#x4E2A;&#x5730;&#x65B9;&#x547D;&#x540D;receiver&#x4E3A; &quot;c&quot;&#xFF0C;&#x90A3;&#x4E48;&#x8BF7;&#x4E0D;&#x8981;&#x5728;&#x53E6;&#x4E00;&#x5904;&#x53EB;&#x5176;&quot;cl&quot;</p>
<h4 id="&#x6307;&#x9488;&#x8FD8;&#x662F;&#x503C;"><a name="&#x6307;&#x9488;&#x8FD8;&#x662F;&#x503C;" class="anchor-navigation-ex-anchor" href="#&#x6307;&#x9488;&#x8FD8;&#x662F;&#x503C;"><i class="fa fa-link" aria-hidden="true"></i></a>&#x6307;&#x9488;&#x8FD8;&#x662F;&#x503C;</h4>
<p>&#x5982;&#x679C;&#x60A8;&#x4E0D;&#x77E5;&#x9053;&#x600E;&#x4E48;&#x51B3;&#x5B9A;&#xFF0C;&#x8BF7;&#x4F7F;&#x7528;&#x6307;&#x9488;&#x3002;&#x4F46;&#x6709;&#x65F6;&#x5019;receiver&#x4E3A;&#x503C;&#x4E5F;&#x633A;&#x6709;&#x7528;&#xFF0C;&#x8FD9;&#x79CD;&#x901A;&#x5E38;&#x662F;&#x51FA;&#x4E8E;&#x6548;&#x7387;&#x7684;&#x539F;&#x56E0;&#xFF0C;&#x4E14;&#x503C;&#x4E3A;&#x5C0F;&#x7684;&#x4E0D;&#x53D8;&#x7ED3;&#x6784;&#x6216;&#x57FA;&#x672C;&#x7C7B;&#x578B;&#x7684;&#x503C;&#x3002;</p>
<p>&#x4E00;&#x4E9B;&#x5EFA;&#x8BAE;&#xFF1A;</p>
<ul>
<li>&#x8BF7;&#x4E0D;&#x8981;&#x4F7F;&#x7528;&#x6307;&#x9488;&#xFF0C;&#x5982;&#x679C;&#x6EE1;&#x8DB3;receiver&#x4E3A;map&#xFF0C;func&#x6216;&#x8005;chan&#xFF0C;&#x6216;receiver&#x4E3A;&#x5207;&#x7247;&#x5E76;&#x4E14;&#x8BE5;&#x65B9;&#x6CD5;&#x4E0D;&#x4F1A;&#x91CD;&#x65B0;&#x5206;&#x914D;&#x5207;&#x7247;</li>
<li>&#x8BF7;&#x4E0D;&#x8981;&#x4F7F;&#x7528;&#x6307;&#x9488;&#xFF0C;&#x5982;&#x679C;receiver&#x662F;&#x8F83;&#x5C0F;&#x6570;&#x7EC4;&#x6216;&#x7ED3;&#x6784;&#x4F53;&#xFF0C;&#x6CA1;&#x6709;&#x53EF;&#x53D8;&#x7684;&#x5B57;&#x6BB5;&#x548C;&#x6307;&#x9488;&#xFF0C;&#x6216;&#x8005;&#x662F;&#x4E00;&#x4E2A;&#x7B80;&#x5355;&#x7684;&#x57FA;&#x672C;&#x7C7B;&#x578B;&#xFF0C;int&#x6216;&#x8005;string</li>
<li>&#x8BF7;&#x4F7F;&#x7528;&#x6307;&#x9488;&#xFF0C;&#x5982;&#x679C;&#x65B9;&#x6CD5;&#x9700;&#x8981;&#x6539;&#x53D8;receiver</li>
<li>&#x8BF7;&#x4F7F;&#x7528;&#x6307;&#x9488;&#xFF0C;&#x4EE5;&#x907F;&#x514D;&#x88AB;&#x62F7;&#x8D1D;&#xFF0C;&#x5982;&#x679C;receiver&#x5305;&#x542B;&#x4E86;sync.Mutex &#x6216;&#x7C7B;&#x4F3C;&#x540C;&#x6B65;&#x5B57;&#x6BB5;&#x7684;&#x7ED3;&#x6784;</li>
<li>&#x8BF7;&#x4F7F;&#x7528;&#x6307;&#x9488;&#xFF0C;&#x4EE5;&#x63D0;&#x5347;&#x6548;&#x7387;&#xFF0C;&#x5982;&#x679C;receiver&#x662F;&#x8F83;&#x5927;&#x7684;&#x6570;&#x7EC4;&#x6216;&#x7ED3;&#x6784;&#x4F53;</li>
<li>&#x8BF7;&#x4F7F;&#x7528;&#x6307;&#x9488;&#xFF0C;&#x5982;&#x679C;&#x9700;&#x8981;&#x5728;&#x65B9;&#x6CD5;&#x4E2D;&#x6539;&#x53D8;receiver&#x7684;&#x503C;</li>
<li>&#x8BF7;&#x4F7F;&#x7528;&#x6307;&#x9488;&#xFF0C;&#x5982;&#x679C;receiver&#x662F;&#x7ED3;&#x6784;&#x4F53;&#xFF0C;&#x6570;&#x7EC4;&#x6216;&#x5207;&#x7247;&#x8FD9;&#x79CD;&#x6210;&#x5458;&#x662F;&#x4E00;&#x4E2A;&#x6307;&#x5411;&#x53EF;&#x53D8;&#x5185;&#x5BB9;&#x7684;&#x6307;&#x9488;</li>
<li>&#x8BF7;&#x4F7F;&#x7528;&#x6307;&#x9488;&#xFF0C;&#x5982;&#x679C;&#x4E0D;&#x6E05;&#x695A;&#x8BE5;&#x5982;&#x4F55;&#x9009;&#x62E9;</li>
</ul>
<h3 id="&#x4F7F;&#x7528;crypto-rand&#x751F;&#x6210;&#x968F;&#x673A;&#x503C;"><a name="&#x4F7F;&#x7528;crypto-rand&#x751F;&#x6210;&#x968F;&#x673A;&#x503C;" class="anchor-navigation-ex-anchor" href="#&#x4F7F;&#x7528;crypto-rand&#x751F;&#x6210;&#x968F;&#x673A;&#x503C;"><i class="fa fa-link" aria-hidden="true"></i></a>&#x4F7F;&#x7528;crypto rand&#x751F;&#x6210;&#x968F;&#x673A;&#x503C;</h3>
<p>&#x8BF7;&#x4E0D;&#x8981;&#x4F7F;&#x7528;&#x5305; <code>math/rand</code> &#x6765;&#x751F;&#x6210;&#x5BC6;&#x94A5;&#xFF0C;&#x5373;&#x4F7F;&#x662F;&#x4E00;&#x6B21;&#x6027;&#x7684;&#x3002;&#x5982;&#x679C;&#x4E0D;&#x63D0;&#x4F9B;&#x79CD;&#x5B50;&#xFF0C;&#x5219;&#x5BC6;&#x94A5;&#x5B8C;&#x5168;&#x53EF;&#x4EE5;&#x88AB;&#x9884;&#x6D4B;&#x5230;&#x3002;&#x5C31;&#x7B97;&#x7528;<code>time.Nanoseconds()</code>&#x4F5C;&#x4E3A;&#x79CD;&#x5B50;&#xFF0C;&#x4E5F;&#x4EC5;&#x4EC5;&#x53EA;&#x6709;&#x51E0;&#x4E2A;&#x4F4D;&#x4E0A;&#x7684;&#x5DEE;&#x522B;&#x3002;</p>
<p>&#x4F7F;&#x7528;<code>crypto/rand</code>&apos;s Reader&#x4F5C;&#x4E3A;&#x4EE3;&#x66FF;&#x3002;&#x5E76;&#x4E14;&#x5982;&#x679C;&#x4F60;&#x9700;&#x8981;&#x751F;&#x6210;&#x6587;&#x672C;&#xFF0C;&#x6253;&#x5370;&#x6210;16&#x8FDB;&#x5236;&#x6216;&#x8005;base64&#x7C7B;&#x578B;&#x5373;&#x53EF;&#x3002;</p>
<pre class="language-"><code class="lang-go"><span class="token keyword">import</span> <span class="token punctuation">(</span>
    <span class="token string">&quot;crypto/rand&quot;</span>
    <span class="token comment">// &quot;encoding/base64&quot;</span>
    <span class="token comment">// &quot;encoding/hex&quot;</span>
    <span class="token string">&quot;fmt&quot;</span>
<span class="token punctuation">)</span>

<span class="token keyword">func</span> <span class="token function">Key</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token builtin">string</span> <span class="token punctuation">{</span>
    buf <span class="token operator">:=</span> <span class="token function">make</span><span class="token punctuation">(</span><span class="token punctuation">[</span><span class="token punctuation">]</span><span class="token builtin">byte</span><span class="token punctuation">,</span> <span class="token number">16</span><span class="token punctuation">)</span>
    <span class="token boolean">_</span><span class="token punctuation">,</span> err <span class="token operator">:=</span> rand<span class="token punctuation">.</span><span class="token function">Read</span><span class="token punctuation">(</span>buf<span class="token punctuation">)</span>
    <span class="token keyword">if</span> err <span class="token operator">!=</span> <span class="token boolean">nil</span> <span class="token punctuation">{</span>
        <span class="token function">panic</span><span class="token punctuation">(</span>err<span class="token punctuation">)</span>  <span class="token comment">// out of randomness, should never happen</span>
    <span class="token punctuation">}</span>
    <span class="token keyword">return</span> fmt<span class="token punctuation">.</span><span class="token function">Sprintf</span><span class="token punctuation">(</span><span class="token string">&quot;%x&quot;</span><span class="token punctuation">,</span> buf<span class="token punctuation">)</span>
    <span class="token comment">// or hex.EncodeToString(buf)</span>
    <span class="token comment">// or base64.StdEncoding.EncodeToString(buf)</span>
<span class="token punctuation">}</span>
</code></pre>
<h2 id="&#x4EE3;&#x7801;&#x8D70;&#x8BFB;&#x68C0;&#x67E5;&#x70B9;"><a name="&#x4EE3;&#x7801;&#x8D70;&#x8BFB;&#x68C0;&#x67E5;&#x70B9;" class="anchor-navigation-ex-anchor" href="#&#x4EE3;&#x7801;&#x8D70;&#x8BFB;&#x68C0;&#x67E5;&#x70B9;"><i class="fa fa-link" aria-hidden="true"></i></a>&#x4EE3;&#x7801;&#x8D70;&#x8BFB;&#x68C0;&#x67E5;&#x70B9;</h2>
<h3 id="&#x68C0;&#x67E5;&#x4E1A;&#x52A1;&#x903B;&#x8F91;"><a name="&#x68C0;&#x67E5;&#x4E1A;&#x52A1;&#x903B;&#x8F91;" class="anchor-navigation-ex-anchor" href="#&#x68C0;&#x67E5;&#x4E1A;&#x52A1;&#x903B;&#x8F91;"><i class="fa fa-link" aria-hidden="true"></i></a>&#x68C0;&#x67E5;&#x4E1A;&#x52A1;&#x903B;&#x8F91;</h3>
<pre class="language-"><code>- &#x64CD;&#x4F5C;&#x987A;&#x5E8F;&#xFF0C; &#x5982;&#xFF1A;&#x5220;&#x9664;&#x64CD;&#x4F5C;&#xFF0C;&#x5148;&#x5904;&#x7406;&#x4E1A;&#x52A1;&#xFF0C;&#x518D;&#x5220;&#x9664;&#x5E93;
</code></pre><h3 id="&#x5F02;&#x5E38;&#x573A;&#x666F;&#x662F;&#x5426;&#x8003;&#x8651;&#x5B8C;&#x5168;"><a name="&#x5F02;&#x5E38;&#x573A;&#x666F;&#x662F;&#x5426;&#x8003;&#x8651;&#x5B8C;&#x5168;" class="anchor-navigation-ex-anchor" href="#&#x5F02;&#x5E38;&#x573A;&#x666F;&#x662F;&#x5426;&#x8003;&#x8651;&#x5B8C;&#x5168;"><i class="fa fa-link" aria-hidden="true"></i></a>&#x5F02;&#x5E38;&#x573A;&#x666F;&#x662F;&#x5426;&#x8003;&#x8651;&#x5B8C;&#x5168;</h3>
<pre class="language-"><code>- &#x7F51;&#x7EDC;&#x4E2D;&#x65AD;&#x5F02;&#x5E38;
- &#x591A;&#x4F7F;&#x7528;&#x573A;&#x666F;&#x7684;&#xFF0C;&#x662F;&#x5426;&#x5217;&#x4E3E;&#x5168;&#x9762;
- &#x4F9D;&#x8D56;&#x7684;&#x7B2C;&#x4E09;&#x65B9;&#x670D;&#x52A1;&#x6682;&#x505C;&#x6216;&#x5347;&#x7EA7;
</code></pre><h3 id="goroutine-&#x662F;&#x5426;&#x5B58;&#x5728;&#x5185;&#x5B58;&#x6CC4;&#x6F0F;"><a name="goroutine-&#x662F;&#x5426;&#x5B58;&#x5728;&#x5185;&#x5B58;&#x6CC4;&#x6F0F;" class="anchor-navigation-ex-anchor" href="#goroutine-&#x662F;&#x5426;&#x5B58;&#x5728;&#x5185;&#x5B58;&#x6CC4;&#x6F0F;"><i class="fa fa-link" aria-hidden="true"></i></a>goroutine &#x662F;&#x5426;&#x5B58;&#x5728;&#x5185;&#x5B58;&#x6CC4;&#x6F0F;</h3>
<pre class="language-"><code>- &#x53D1;&#x9001;&#x5230;&#x4E00;&#x4E2A;&#x6CA1;&#x6709;&#x63A5;&#x53D7;&#x8005;&#x7684;channel
- &#x4ECE;&#x6CA1;&#x6709;&#x53D1;&#x9001;&#x8005;&#x7684;channel&#x4E2D;&#x63A5;&#x53D7;&#x6570;&#x636E;
- &#x4F20;&#x9012;&#x5C1A;&#x672A;&#x521D;&#x59CB;&#x5316;&#x7684;channel
- goroutine &#x6CC4;&#x9732;&#x4E0D;&#x4EC5;&#x4EC5;&#x662F;&#x56E0;&#x4E3A; channel &#x7684;&#x9519;&#x8BEF;&#x4F7F;&#x7528;&#x9020;&#x6210;&#x7684;&#x3002;&#x6CC4;&#x9732;&#x7684;&#x539F;&#x56E0;&#x4E5F;&#x53EF;&#x80FD;&#x662F; I/O &#x64CD;&#x4F5C;&#x4E0A;&#x7684;&#x5835;&#x585E;&#xFF0C;&#x4F8B;&#x5982;&#x53D1;&#x9001;&#x8BF7;&#x6C42;&#x5230; API &#x670D;&#x52A1;&#x5668;&#xFF0C;&#x800C;&#x6CA1;&#x6709;&#x4F7F;&#x7528;&#x8D85;&#x65F6;&#x3002;&#x53E6;&#x4E00;&#x79CD;&#x539F;&#x56E0;&#x662F;&#xFF0C;&#x7A0B;&#x5E8F;&#x53EF;&#x4EE5;&#x5355;&#x7EAF;&#x5730;&#x9677;&#x5165;&#x6B7B;&#x5FAA;&#x73AF;&#x4E2D;
</code></pre><h3 id="&#x662F;&#x5426;&#x5B58;&#x5728;&#x8FC7;&#x591A;&#x7684;&#x91CD;&#x590D;&#x4EE3;&#x7801;&#xFF0C;&#x53EF;&#x4EE5;&#x62BD;&#x8C61;"><a name="&#x662F;&#x5426;&#x5B58;&#x5728;&#x8FC7;&#x591A;&#x7684;&#x91CD;&#x590D;&#x4EE3;&#x7801;&#xFF0C;&#x53EF;&#x4EE5;&#x62BD;&#x8C61;" class="anchor-navigation-ex-anchor" href="#&#x662F;&#x5426;&#x5B58;&#x5728;&#x8FC7;&#x591A;&#x7684;&#x91CD;&#x590D;&#x4EE3;&#x7801;&#xFF0C;&#x53EF;&#x4EE5;&#x62BD;&#x8C61;"><i class="fa fa-link" aria-hidden="true"></i></a>&#x662F;&#x5426;&#x5B58;&#x5728;&#x8FC7;&#x591A;&#x7684;&#x91CD;&#x590D;&#x4EE3;&#x7801;&#xFF0C;&#x53EF;&#x4EE5;&#x62BD;&#x8C61;</h3>
<pre class="language-"><code>- log &#x6253;&#x5370;&#x5C3D;&#x91CF;&#x653E;&#x5230;&#x6700;&#x5916;&#x5C42;
</code></pre><h3 id="&#x5E76;&#x53D1;&#x64CD;&#x4F5C;&#x662F;&#x5426;&#x5B89;&#x5168;"><a name="&#x5E76;&#x53D1;&#x64CD;&#x4F5C;&#x662F;&#x5426;&#x5B89;&#x5168;" class="anchor-navigation-ex-anchor" href="#&#x5E76;&#x53D1;&#x64CD;&#x4F5C;&#x662F;&#x5426;&#x5B89;&#x5168;"><i class="fa fa-link" aria-hidden="true"></i></a>&#x5E76;&#x53D1;&#x64CD;&#x4F5C;&#x662F;&#x5426;&#x5B89;&#x5168;</h3>
<pre class="language-"><code>- map &#x5E76;&#x53D1;&#x5199;&#x8981;&#x52A0;&#x9501;
- &#x6570;&#x636E;&#x5E93;&#x8BB0;&#x5F55;&#x4FEE;&#x6539;&#x9700;&#x8981;&#x4F7F;&#x7528;&#x5E26;&#x5224;&#x65AD;&#x7684;&#x539F;&#x5B50;&#x64CD;&#x4F5C;&#x4FEE;&#x6539;, update ... set ... where condition
- &#x4F7F;&#x7528;&#x9501;&#x7684;&#x8981;&#x8BB0;&#x5F97;&#x89E3;&#x9501;, defer unlock
</code></pre><h3 id="&#x6570;&#x636E;&#x5E93;&#x64CD;&#x4F5C;"><a name="&#x6570;&#x636E;&#x5E93;&#x64CD;&#x4F5C;" class="anchor-navigation-ex-anchor" href="#&#x6570;&#x636E;&#x5E93;&#x64CD;&#x4F5C;"><i class="fa fa-link" aria-hidden="true"></i></a>&#x6570;&#x636E;&#x5E93;&#x64CD;&#x4F5C;</h3>
<pre class="language-"><code>- &#x6700;&#x5927;&#x8FDE;&#x63A5;&#x6570;&#x8BBE;&#x7F6E;
- &#x5931;&#x8D25;&#x91CD;&#x8FDE;&#x63A5;
- &#x5931;&#x8D25;&#x540E;&#x662F;&#x5426;&#x9700;&#x8981;&#x56DE;&#x6EDA;&#x64CD;&#x4F5C;
- &#x63D2;&#x5165;&#x524D;&#x6570;&#x636E;&#x5E93;&#x91CD;&#x590D;&#x6761;&#x76EE;&#x68C0;&#x67E5;
- &#x5220;&#x9664;&#x524D;&#x5173;&#x8054;&#x5E94;&#x7528;&#x662F;&#x5426;&#x5DF2;&#x7ECF;&#x5220;&#x9664; 
</code></pre><footer class="page-footer"><span class="copyright">Copyright &#xA9; caixisheng 2017 all right reserved&#xFF0C;powered by Gitbook</span><span class="footer-modification">&#x8BE5;&#x6587;&#x4EF6;&#x4FEE;&#x8BA2;&#x65F6;&#x95F4;&#xFF1A;
2021-05-19 10:46:05
</span></footer> <link rel="stylesheet" type="text/css" href="https://storage.googleapis.com/app.klipse.tech/css/codemirror.css"> <script>     window.klipse_settings = {         selector: ".language-klipse, .lang-eval-clojure",         selector_eval_js: ".lang-eval-js",         selector_eval_python_client: ".lang-eval-python",         selector_eval_php: ".lang-eval-php",         selector_eval_scheme: ".lang-eval-scheme",         selector_eval_ruby: ".lang-eval-ruby",         selector_reagent: ".lang-reagent",        selector_google_charts: ".lang-google-chart",        selector_es2017: ".lang-eval-es2017",        selector_jsx: ".lang-eval-jsx",        selector_transpile_jsx: ".lang-transpile-jsx",        selector_render_jsx: ".lang-render-jsx",        selector_react: ".lang-react",        selector_eval_markdown: ".lang-render-markdown",        selector_eval_lambdaway: ".lang-render-lambdaway",        selector_eval_cpp: ".lang-eval-cpp",        selector_eval_html: ".lang-render-html",        selector_sql: ".lang-eval-sql",        selector_brainfuck: "lang-eval-brainfuck",        selector_js: ".lang-transpile-cljs"    }; </script> <script src="https://storage.googleapis.com/app.klipse.tech/plugin/js/klipse_plugin.js"></script>
                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                <a href="git规范.html" class="navigation navigation-prev " aria-label="Previous page: Git规范">
                    <i class="fa fa-angle-left"></i>
                </a>
                
                
                <a href="readme.html" class="navigation navigation-next " aria-label="Next page: Readme">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"Golang 代码规范","level":"1.14.3","depth":2,"next":{"title":"Readme","level":"1.14.4","depth":2,"path":"blog/规范/readme.md","ref":"blog/规范/readme.md","articles":[]},"previous":{"title":"Git规范","level":"1.14.2","depth":2,"path":"blog/规范/git规范.md","ref":"blog/规范/git规范.md","articles":[]},"dir":"ltr"},"config":{"plugins":["summary","expandable-chapters","toggle-chapters","theme-comscore","-lunr","-search","-highlight","-livereload","search-plus@^0.0.11","simple-page-toc@^0.1.1","github@^2.0.0","github-buttons@2.1.0","edit-link@^2.0.2","disqus@^0.1.0","prism@^2.1.0","prism-themes@^0.0.2","advanced-emoji@^0.2.1","anchors@^0.7.1","include-codeblock@^3.0.2","emphasize@^1.1.0","katex@^1.1.3","splitter@^0.0.8","mermaid-gb3@2.1.0","tbfed-pagefooter@^0.0.1","expandable-chapters-small@^0.1.7","sectionx@^3.1.0","donate@^1.0.2","local-video@^1.0.1","anchor-navigation-ex@0.1.8","favicon@^0.0.2","3-ba@^0.9.0","terminal@^0.3.2","alerts@^0.2.0","include-csv@^0.1.0","puml@^1.0.1","musicxml@^1.0.2","klipse@^1.2.0","versions-select@^0.1.1","-sharing","sharing-plus@^0.0.2","graph@^0.1.0","chart@^0.2.0"],"root":".","styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"tbfed-pagefooter":{"copyright":"Copyright © caixisheng 2017","modify_label":"该文件修订时间：","modify_format":"YYYY-MM-DD HH:mm:ss"},"prism":{"css":["prism-themes/themes/prism-base16-ateliersulphurpool.light.css"]},"include-csv":{},"disqus":{"useIdentifier":false,"shortName":"gitbookuse"},"emphasize":{},"github":{"url":"https://github.com/xishengcai/xisheng.blog"},"puml":{},"simple-page-toc":{"maxDepth":3,"skipFirstH1":true},"summary":{},"splitter":{},"sharing-plus":{"qq":false,"all":["facebook","google","twitter","instapaper","linkedin","pocket","stumbleupon"],"douban":false,"facebook":true,"weibo":false,"instapaper":false,"whatsapp":false,"hatenaBookmark":false,"twitter":true,"messenger":false,"line":false,"vk":false,"pocket":true,"google":false,"viber":false,"stumbleupon":false,"qzone":false,"linkedin":false},"versions-select":{"type":"branches"},"graph":{},"donate":{"alipay":"https://cai-hello-1253732611.cos.ap-shanghai.myqcloud.com/share/zhifubao-pay.jpg","alipayText":"支付宝打赏","button":"赏","title":"","wechat":"https://cai-hello-1253732611.cos.ap-shanghai.myqcloud.com/share/weixin-pay.jpg","wechatText":"微信打赏"},"katex":{},"fontsettings":{"theme":"white","family":"sans","size":2},"musicxml":{},"sectionx":{"tag":"b"},"mermaid-gb3":{},"anchor-navigation-ex":{"isRewritePageTitle":false,"tocLevel1Icon":"fa fa-hand-o-right","tocLevel2Icon":"fa fa-hand-o-right","tocLevel3Icon":"fa fa-hand-o-right"},"favicon":{"shortcut":"favicon.ico","bookmark":"favicon.ico"},"theme-comscore":{},"prism-themes":{},"alerts":{},"github-buttons":{"repo":"xishengcai/xisheng.blog","types":["star"],"size":"small"},"3-ba":{"configuration":"auto","token":"ff100361cdce95dd4c8fb96b4009f7bc"},"expandable-chapters-small":{},"local-video":{},"klipse":{"myConfigKey":"it's the default value"},"advanced-emoji":{"embedEmojis":false},"include-codeblock":{"check":false,"edit":true,"fixlang":false,"lang":"","template":"ace","theme":"chrome","unindent":true},"sharing":{"qq":false,"all":["facebook","google","twitter","weibo","instapaper","linkedin","pocket","stumbleupon","qq","qzone"],"douban":false,"facebook":false,"weibo":true,"instapaper":false,"whatsapp":false,"hatenaBookmark":false,"twitter":false,"messenger":false,"line":false,"vk":false,"pocket":false,"google":true,"viber":false,"stumbleupon":false,"qzone":false,"linkedin":true},"terminal":{"copyButtons":true,"fade":false,"style":"flat"},"edit-link":{"label":"Edit This Page","base":"https://github.com/xishengcai/xisheng.blog/edit/master"},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":true},"anchors":{},"chart":{"type":"c3"},"toggle-chapters":{},"expandable-chapters":{},"search-plus":{}},"theme":"default","author":"xishengcai","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"这是程序员吗","language":"zh-hans","output.name":"site","links":{"sidebar":{"Home":"https://xisheng.vip"}},"gitbook":"3.2.3","description":"这是程序员吗"},"file":{"path":"blog/规范/golang 代码规范.md","mtime":"2021-05-19T02:46:05.230Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2021-06-23T07:51:54.455Z"},"basePath":"../..","book":{"language":""}});
        });
    </script>
</div>

        
    
    <script src="../../gitbook/gitbook.js"></script>
    <script src="../../gitbook/theme.js"></script>
    
        
        <script src="../../gitbook/gitbook-plugin-expandable-chapters/expandable-chapters.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-toggle-chapters/toggle.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-search-plus/jquery.mark.min.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-search-plus/search.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-github/plugin.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-github-buttons/plugin.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-edit-link/plugin.js"></script>
        
    
        
        <script src="https://cdnjs.cloudflare.com/ajax/libs/URI.js/1.16.1/URI.min.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-disqus/plugin.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-splitter/splitter.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-mermaid-gb3/book/plugin.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-expandable-chapters-small/expandable-chapters-small.js"></script>
        
    
        
        <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-sectionx/sectionx.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-donate/plugin.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-local-video/video.min.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-3-ba/plugin.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-terminal/plugin.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-alerts/plugin.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-musicxml/osmd.min.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-musicxml/musicxml.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-musicxml/promise.min.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-versions-select/plugin.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-sharing-plus/buttons.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-theme-comscore/test.js"></script>
        
    

    <script src="../../gitbook/gitbook-plugin-mermaid-gb3/mermaid/mermaid.min.js"></script>

    </body>
</html>

